示例#1
0
func TestBarProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := math_rand.New(math_rand.NewSource(seed))
	p := NewPopulatedBar(popr, true)
	data := github_com_gogo_protobuf_proto.CompactTextString(p)
	msg := &Bar{}
	if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	if !p.Equal(msg) {
		t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
	}
}
func TestOldWithGroup_Group2ProtoCompactText(t *testing.T) {
	seed := time.Now().UnixNano()
	popr := math_rand.New(math_rand.NewSource(seed))
	p := NewPopulatedOldWithGroup_Group2(popr, true)
	data := github_com_gogo_protobuf_proto.CompactTextString(p)
	msg := &OldWithGroup_Group2{}
	if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil {
		t.Fatalf("seed = %d, err = %v", seed, err)
	}
	if err := p.VerboseEqual(msg); err != nil {
		t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err)
	}
	if !p.Equal(msg) {
		t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p)
	}
}
示例#3
0
func (m *NinOptEnum) String() string { return proto.CompactTextString(m) }
示例#4
0
func (m *CodeGeneratorRequest) String() string { return proto.CompactTextString(m) }
示例#5
0
func (m *PrivateKey) String() string { return proto.CompactTextString(m) }
示例#6
0
func (m *B) String() string { return proto.CompactTextString(m) }
示例#7
0
func (m *IndexQuery) String() string { return proto.CompactTextString(m) }
示例#8
0
func (m *Communique_Delta) String() string { return proto.CompactTextString(m) }
示例#9
0
func (m *MsgWithOneof) String() string { return proto.CompactTextString(m) }
示例#10
0
func (m *Repeats) String() string { return proto.CompactTextString(m) }
示例#11
0
func (m *Simple3) String() string { return proto.CompactTextString(m) }
示例#12
0
func (m *OrderedFields) String() string { return proto.CompactTextString(m) }
示例#13
0
func (m *Exchange) String() string { return proto.CompactTextString(m) }
示例#14
0
func (m *Propose) String() string { return proto.CompactTextString(m) }
示例#15
0
func (m *FooWithRepeated) String() string { return proto.CompactTextString(m) }
示例#16
0
func (m *OldReply) String() string { return proto.CompactTextString(m) }
示例#17
0
func (m *Communique_SomeGroup) String() string { return proto.CompactTextString(m) }
示例#18
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)
	}
}
示例#19
0
func (m *MessageWithMap) String() string { return proto.CompactTextString(m) }
示例#20
0
func (m *Request) String() string { return proto.CompactTextString(m) }
示例#21
0
func (m *MoreDefaultsA) String() string { return proto.CompactTextString(m) }
示例#22
0
func (m *Request_SomeGroup) String() string { return proto.CompactTextString(m) }
示例#23
0
func (m *MyMessage) String() string { return proto.CompactTextString(m) }
示例#24
0
func (m *Reply_Entry) String() string { return proto.CompactTextString(m) }
示例#25
0
func (m *PublicKey) String() string { return proto.CompactTextString(m) }
示例#26
0
func (m *OtherBase) String() string { return proto.CompactTextString(m) }
示例#27
0
func (m *Foo) String() string { return proto1.CompactTextString(m) }
示例#28
0
func (m *OtherReplyExtensions) String() string { return proto.CompactTextString(m) }
示例#29
0
func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
示例#30
0
func (m *SubObject) String() string { return proto.CompactTextString(m) }