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

Function TestReadJSONRPCResponse_InvalidJSON

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

Source from the content-addressed store, hash-verified

75}
76
77func TestReadJSONRPCResponse_InvalidJSON(t *testing.T) {
78 t.Parallel()
79 input := "not valid json\n"
80 scanner := bufio.NewScanner(strings.NewReader(input))
81
82 _, err := readJSONRPCResponse(scanner)
83 if err == nil {
84 t.Fatal("expected error for invalid JSON, got nil")
85 }
86 if !strings.Contains(err.Error(), "failed to parse JSON-RPC message") {
87 t.Fatalf("expected parse error, got: %v", err)
88 }
89}
90
91func TestReadJSONRPCResponse_ServerError(t *testing.T) {
92 t.Parallel()

Callers

nothing calls this directly

Calls 2

readJSONRPCResponseFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected