(t *testing.T)
| 4261 | } |
| 4262 | |
| 4263 | func TestInt16Sorted_NilHandling(t *testing.T) { |
| 4264 | var nilSet Int16Sorted |
| 4265 | |
| 4266 | // Test nil encoding |
| 4267 | var buf bytes.Buffer |
| 4268 | writer := msgp.NewWriter(&buf) |
| 4269 | err := nilSet.EncodeMsg(writer) |
| 4270 | if err != nil { |
| 4271 | t.Fatalf("EncodeMsg failed for nil: %v", err) |
| 4272 | } |
| 4273 | writer.Flush() |
| 4274 | |
| 4275 | // Test nil decoding |
| 4276 | reader := msgp.NewReader(&buf) |
| 4277 | var decoded Int16Sorted |
| 4278 | err = decoded.DecodeMsg(reader) |
| 4279 | if err != nil { |
| 4280 | t.Fatalf("DecodeMsg failed for nil: %v", err) |
| 4281 | } |
| 4282 | |
| 4283 | if decoded != nil { |
| 4284 | t.Fatal("expected nil, got non-nil") |
| 4285 | } |
| 4286 | |
| 4287 | // Test nil marshaling |
| 4288 | data, err := nilSet.MarshalMsg(nil) |
| 4289 | if err != nil { |
| 4290 | t.Fatalf("MarshalMsg failed for nil: %v", err) |
| 4291 | } |
| 4292 | |
| 4293 | // Test nil unmarshaling |
| 4294 | var unmarshaled Int16Sorted |
| 4295 | _, err = unmarshaled.UnmarshalMsg(data) |
| 4296 | if err != nil { |
| 4297 | t.Fatalf("UnmarshalMsg failed for nil: %v", err) |
| 4298 | } |
| 4299 | |
| 4300 | if unmarshaled != nil { |
| 4301 | t.Fatal("expected nil, got non-nil") |
| 4302 | } |
| 4303 | |
| 4304 | // Test AsSlice on nil |
| 4305 | slice := nilSet.AsSlice() |
| 4306 | if slice != nil { |
| 4307 | t.Fatal("expected nil slice, got non-nil") |
| 4308 | } |
| 4309 | |
| 4310 | // Test FromSlice with nil |
| 4311 | fromNilSlice := Int16SortedFromSlice(nil) |
| 4312 | if fromNilSlice != nil { |
| 4313 | t.Fatal("expected nil from nil slice, got non-nil") |
| 4314 | } |
| 4315 | } |
| 4316 | |
| 4317 | func TestInt16Sorted_EmptySet(t *testing.T) { |
| 4318 | set := make(Int16Sorted) |
nothing calls this directly
no test coverage detected
searching dependent graphs…