TestStringSetMsgpBinary tests MarshalBinary/UnmarshalBinary for StringSet
(t *testing.T)
| 115 | |
| 116 | // TestStringSetMsgpBinary tests MarshalBinary/UnmarshalBinary for StringSet |
| 117 | func 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 |
| 137 | func TestStringSetMsgpAppendBinary(t *testing.T) { |
nothing calls this directly
no test coverage detected