MCPcopy Index your code
hub / github.com/github/github-mcp-server / TestReadJSONRPCResponse_DirectResponse

Function TestReadJSONRPCResponse_DirectResponse

cmd/mcpcurl/main_test.go:10–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func 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
24func TestReadJSONRPCResponse_SkipsNotifications(t *testing.T) {
25 t.Parallel()

Callers

nothing calls this directly

Calls 1

readJSONRPCResponseFunction · 0.85

Tested by

no test coverage detected