예제 #1
0
func TestPBNodeProtoCompactText(t *testing.T) {
	popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
	p := NewPopulatedPBNode(popr, true)
	data := github_com_gogo_protobuf_proto.CompactTextString(p)
	msg := &PBNode{}
	if err := github_com_gogo_protobuf_proto.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)
	}
}
예제 #2
0
func (m *Message_Wantlist_Entry) String() string { return proto.CompactTextString(m) }
예제 #3
0
func (m *Message) String() string { return proto.CompactTextString(m) }
예제 #4
0
func (m *IpnsEntry) String() string { return proto.CompactTextString(m) }
예제 #5
0
func (m *Data) String() string { return proto.CompactTextString(m) }
예제 #6
0
func (m *Identify) String() string { return proto.CompactTextString(m) }
예제 #7
0
func (m *Record) String() string { return proto.CompactTextString(m) }
예제 #8
0
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)
	}
}
예제 #9
0
func (m *Exchange) String() string { return proto.CompactTextString(m) }
예제 #10
0
func (m *Propose) String() string { return proto.CompactTextString(m) }