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

Function TestNidRepPackedNativeJSON

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

Source from the content-addressed store, hash-verified

5138 }
5139}
5140func TestNidRepPackedNativeJSON(t *testing.T) {
5141 seed := time.Now().UnixNano()
5142 popr := math_rand.New(math_rand.NewSource(seed))
5143 p := NewPopulatedNidRepPackedNative(popr, true)
5144 marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{}
5145 jsondata, err := marshaler.MarshalToString(p)
5146 if err != nil {
5147 t.Fatalf("seed = %d, err = %v", seed, err)
5148 }
5149 msg := &NidRepPackedNative{}
5150 err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg)
5151 if err != nil {
5152 t.Fatalf("seed = %d, err = %v", seed, err)
5153 }
5154 if err := p.VerboseEqual(msg); err != nil {
5155 t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
5156 }
5157 if !p.Equal(msg) {
5158 t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p)
5159 }
5160}
5161func TestNinRepPackedNativeJSON(t *testing.T) {
5162 seed := time.Now().UnixNano()
5163 popr := math_rand.New(math_rand.NewSource(seed))

Callers

nothing calls this directly

Calls 4

MarshalToStringMethod · 0.95
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…