MCPcopy
hub / github.com/gogo/protobuf / TestNinRepNativeJSON

Function TestNinRepNativeJSON

test/thetestpb_test.go:5119–5139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5117 }
5118}
5119func TestNinRepNativeJSON(t *testing.T) {
5120 seed := time.Now().UnixNano()
5121 popr := math_rand.New(math_rand.NewSource(seed))
5122 p := NewPopulatedNinRepNative(popr, true)
5123 marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
5124 jsondata, err := marshaler.MarshalToString(p)
5125 if err != nil {
5126 t.Fatalf("seed = %d, err = %v", seed, err)
5127 }
5128 msg := &NinRepNative{}
5129 err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
5130 if err != nil {
5131 t.Fatalf("seed = %d, err = %v", seed, err)
5132 }
5133 if err := p.VerboseEqual(msg); err != nil {
5134 t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
5135 }
5136 if !p.Equal(msg) {
5137 t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
5138 }
5139}
5140func TestNidRepPackedNativeJSON(t *testing.T) {
5141 seed := time.Now().UnixNano()
5142 popr := math_rand.New(math_rand.NewSource(seed))

Callers

nothing calls this directly

Calls 4

MarshalToStringMethod · 0.95
NewPopulatedNinRepNativeFunction · 0.70
VerboseEqualMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…