func TestPBNodeProtoCompactText(t *testing2.T) { popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) p := NewPopulatedPBNode(popr, true) data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p) msg := &PBNode{} if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) } if !p.Equal(msg) { t.Fatalf("%#v !Proto %#v", msg, p) } }
func TestCompactText(t *testing.T) { s := proto.CompactTextString(newTestMessage()) if s != compactText { t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v\n===\n", s, compactText) } }