(t *testing.T)
| 387 | } |
| 388 | |
| 389 | func (s) TestBuffer_SliceSubslice(t *testing.T) { |
| 390 | for _, c := range ctors { |
| 391 | t.Run(c.name+" subslice", func(t *testing.T) { |
| 392 | buf := c.newBuf([]byte{1, 2, 3, 4}) |
| 393 | slice := buf.Slice(1, 3) |
| 394 | slice2 := slice.Slice(0, 1) |
| 395 | if !bytes.Equal(slice2.ReadOnlyData(), []byte{2}) { |
| 396 | t.Fatalf("Buffer did not contain expected data. got %v, want %v", buf.ReadOnlyData(), []byte{2}) |
| 397 | } |
| 398 | }) |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | func (s) TestBuffer_SliceEmpty(t *testing.T) { |
| 403 | allCtors := append(slices.Clip(ctors), namedCtor{name: "empty", newBuf: newEmptyBuf}) |
nothing calls this directly
no test coverage detected