TestIntSetMsgpBinary tests MarshalBinary/UnmarshalBinary for IntSet
(t *testing.T)
| 302 | |
| 303 | // TestIntSetMsgpBinary tests MarshalBinary/UnmarshalBinary for IntSet |
| 304 | func TestIntSetMsgpBinary(t *testing.T) { |
| 305 | original := CreateIntSet(10, 20, 30, 40, 50) |
| 306 | |
| 307 | data, err := original.MarshalBinary() |
| 308 | if err != nil { |
| 309 | t.Fatalf("MarshalBinary() error = %v", err) |
| 310 | } |
| 311 | |
| 312 | var decoded IntSet |
| 313 | err = decoded.UnmarshalBinary(data) |
| 314 | if err != nil { |
| 315 | t.Fatalf("UnmarshalBinary() error = %v", err) |
| 316 | } |
| 317 | |
| 318 | if !original.Equals(decoded) { |
| 319 | t.Errorf("Binary roundtrip failed: original=%v, decoded=%v", original.ToSlice(), decoded.ToSlice()) |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | // TestIntSetMsgpAppendBinary tests AppendBinary for IntSet |
| 324 | func TestIntSetMsgpAppendBinary(t *testing.T) { |
nothing calls this directly
no test coverage detected