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

Function TestStringSetMsgpBinary

pkg/set/msgp_test.go:117–134  ·  view source on GitHub ↗

TestStringSetMsgpBinary tests MarshalBinary/UnmarshalBinary for StringSet

(t *testing.T)

Source from the content-addressed store, hash-verified

115
116// TestStringSetMsgpBinary tests MarshalBinary/UnmarshalBinary for StringSet
117func TestStringSetMsgpBinary(t *testing.T) {
118 original := CreateStringSet("one", "two", "three")
119
120 data, err := original.MarshalBinary()
121 if err != nil {
122 t.Fatalf("MarshalBinary() error = %v", err)
123 }
124
125 var decoded StringSet
126 err = decoded.UnmarshalBinary(data)
127 if err != nil {
128 t.Fatalf("UnmarshalBinary() error = %v", err)
129 }
130
131 if !original.Equals(decoded) {
132 t.Errorf("Binary roundtrip failed: original=%v, decoded=%v", original.ToSlice(), decoded.ToSlice())
133 }
134}
135
136// TestStringSetMsgpAppendBinary tests AppendBinary for StringSet
137func TestStringSetMsgpAppendBinary(t *testing.T) {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected