(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestCodecObject(t *testing.T) { |
| 11 | now := Now() |
| 12 | tests := []*Object{ |
| 13 | &Object{ |
| 14 | ID: []byte("1234567890123456"), |
| 15 | CreatedAt: now, |
| 16 | UpdatedAt: now, |
| 17 | ExpireAt: 0, |
| 18 | Type: ObjectString, |
| 19 | Encoding: ObjectEncodingRaw, |
| 20 | }, |
| 21 | } |
| 22 | for _, obj := range tests { |
| 23 | got, err := DecodeObject(EncodeObject(obj)) |
| 24 | if err != nil { |
| 25 | t.Fatalf("decode object get error: %s", err) |
| 26 | } |
| 27 | if !reflect.DeepEqual(got, obj) { |
| 28 | t.Fatalf("decode failed want=%v, got=%v", obj, got) |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | func TestCodecEncodeInt64(t *testing.T) { |
| 34 | values := []int64{math.MinInt64, -1, 0, 1, math.MaxInt64} |
nothing calls this directly
no test coverage detected