MCPcopy
hub / github.com/grpc/grpc-go / TestJSONUnmarshal

Method TestJSONUnmarshal

codes/codes_test.go:49–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func (s) TestJSONUnmarshal(t *testing.T) {
50 var got []Code
51 want := []Code{OK, NotFound, Internal, Canceled}
52 in := `["OK", "NOT_FOUND", "INTERNAL", "CANCELLED"]`
53 err := json.Unmarshal([]byte(in), &got)
54 if err != nil || !cmp.Equal(got, want) {
55 t.Fatalf("json.Unmarshal(%q, &got) = %v; want <nil>. got=%v; want %v", in, err, got, want)
56 }
57}
58
59func (s) TestUnmarshalJSON_NilReceiver(t *testing.T) {
60 var got *Code

Callers

nothing calls this directly

Calls 3

UnmarshalMethod · 0.65
EqualMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected