(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestFuzzyByteSlicePools(t *testing.T) { |
| 12 | sut := newSlicePool(20) |
| 13 | maxByteSize := int(math.Pow(2, 20+minPoolSizePower-1)) |
| 14 | |
| 15 | for range 1000 { |
| 16 | size := rand.Int() % maxByteSize |
| 17 | s := sut.getSlice(size) |
| 18 | assert.Equal(t, len(*s), size) |
| 19 | sut.reuseSlice(s) |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | func TestReturnSliceSmallerThanMin(t *testing.T) { |
| 24 | sut := newSlicePool(20) |
nothing calls this directly
no test coverage detected