MCPcopy
hub / github.com/minio/minio-go / TestIntSetMsgpBinary

Function TestIntSetMsgpBinary

pkg/set/msgp_test.go:304–321  ·  view source on GitHub ↗

TestIntSetMsgpBinary tests MarshalBinary/UnmarshalBinary for IntSet

(t *testing.T)

Source from the content-addressed store, hash-verified

302
303// TestIntSetMsgpBinary tests MarshalBinary/UnmarshalBinary for IntSet
304func 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
324func TestIntSetMsgpAppendBinary(t *testing.T) {

Callers

nothing calls this directly

Calls 6

UnmarshalBinaryMethod · 0.95
ToSliceMethod · 0.95
CreateIntSetFunction · 0.85
MarshalBinaryMethod · 0.45
EqualsMethod · 0.45
ToSliceMethod · 0.45

Tested by

no test coverage detected