(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestReadJSONRPCResponse_DirectResponse(t *testing.T) { |
| 11 | t.Parallel() |
| 12 | input := `{"jsonrpc":"2.0","id":1,"result":{"tools":[]}}` + "\n" |
| 13 | scanner := bufio.NewScanner(strings.NewReader(input)) |
| 14 | |
| 15 | got, err := readJSONRPCResponse(scanner) |
| 16 | if err != nil { |
| 17 | t.Fatalf("unexpected error: %v", err) |
| 18 | } |
| 19 | if got != `{"jsonrpc":"2.0","id":1,"result":{"tools":[]}}` { |
| 20 | t.Fatalf("unexpected response: %s", got) |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | func TestReadJSONRPCResponse_SkipsNotifications(t *testing.T) { |
| 25 | t.Parallel() |
nothing calls this directly
no test coverage detected