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

Function TestReadJSONRPCResponse_NoResponse

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

Source from the content-addressed store, hash-verified

50}
51
52func 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
67func TestReadJSONRPCResponse_EmptyInput(t *testing.T) {
68 t.Parallel()

Callers

nothing calls this directly

Calls 2

readJSONRPCResponseFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected