(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestReadJSONRPCResponse_NoResponse(t *testing.T) { |
| 53 | t.Parallel() |
| 54 | // Only notifications, no response |
| 55 | input := `{"jsonrpc":"2.0","method":"notifications/resources/list_changed","params":{}}` + "\n" |
| 56 | scanner := bufio.NewScanner(strings.NewReader(input)) |
| 57 | |
| 58 | _, err := readJSONRPCResponse(scanner) |
| 59 | if err == nil { |
| 60 | t.Fatal("expected error for missing response, got nil") |
| 61 | } |
| 62 | if !strings.Contains(err.Error(), "unexpected end of output") { |
| 63 | t.Fatalf("expected 'unexpected end of output' error, got: %v", err) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | func TestReadJSONRPCResponse_EmptyInput(t *testing.T) { |
| 68 | t.Parallel() |
nothing calls this directly
no test coverage detected