Files
storm/codec/sereal/sereal_test.go
2019-09-30 13:45:14 -05:00

22 lines
379 B
Go

package sereal
import (
"testing"
"github.com/asdine/storm/v3/codec/internal"
"github.com/stretchr/testify/require"
)
type SerealUser struct {
Name string
Self *SerealUser
}
func TestSereal(t *testing.T) {
u1 := &SerealUser{Name: "Sereal"}
u1.Self = u1 // cyclic ref
u2 := &SerealUser{}
internal.RoundtripTester(t, Codec, &u1, &u2)
require.True(t, u2 == u2.Self)
}