示例#1
0
func TestSereal(t *testing.T) {
	u1 := &SerealUser{Name: "Sereal"}
	u1.Self = u1 // cyclic ref
	u2 := &SerealUser{}
	internal.RoundtripTester(t, Codec, &u1, &u2)
	assert.True(t, u2 == u2.Self)
}
示例#2
0
文件: gob_test.go 项目: asdine/storm
func TestGob(t *testing.T) {
	internal.RoundtripTester(t, Codec)
}
示例#3
0
func TestProtobuf(t *testing.T) {
	u1 := SimpleUser{Id: 1, Name: "John"}
	u2 := SimpleUser{}
	internal.RoundtripTester(t, Codec, &u1, &u2)
	assert.True(t, u1.Id == u2.Id)
}