MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / checkJSON

Function checkJSON

internal/jsonrpc2/wire_test.go:105–118  ·  view source on GitHub ↗
(t *testing.T, got, want []byte)

Source from the content-addressed store, hash-verified

103}
104
105func checkJSON(t *testing.T, got, want []byte) {
106 // compare the compact form, to allow for formatting differences
107 g := &bytes.Buffer{}
108 if err := json.Compact(g, []byte(got)); err != nil {
109 t.Fatal(err)
110 }
111 w := &bytes.Buffer{}
112 if err := json.Compact(w, []byte(want)); err != nil {
113 t.Fatal(err)
114 }
115 if g.String() != w.String() {
116 t.Errorf("encoded message does not match\nGot:\n%s\nWant:\n%s", g, w)
117 }
118}

Callers 1

TestWireMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…