diff --git a/pool_test.go b/pool_test.go index 1941144e94baf3cc68793bba0592ce208d4a007f..7421bd5852a25c017ecc68c023857b870de8e545 100644 --- a/pool_test.go +++ b/pool_test.go @@ -32,6 +32,17 @@ func TestAllocations(t *testing.T) { } } +func TestRange(t *testing.T) { + min := nextLogBase2(1) + max := nextLogBase2(uint32(MaxLength)) + if int(max) != len(GlobalPool.pools)-1 { + t.Errorf("expected %d pools, found %d", max, len(GlobalPool.pools)) + } + if min != 0 { + t.Errorf("unused min pool") + } +} + func TestPool(t *testing.T) { // disable GC so we can control when it happens. defer debug.SetGCPercent(debug.SetGCPercent(-1))