(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func TestIntPoolPoolPut(t *testing.T) { |
| 33 | poolOfIntPools.pools = make([]*intPool, 0, poolDefaultCap) |
| 34 | |
| 35 | nip := poolOfIntPools.get() |
| 36 | if len(poolOfIntPools.pools) != 0 { |
| 37 | t.Fatalf("Pool got added to list when none should have been") |
| 38 | } |
| 39 | |
| 40 | poolOfIntPools.put(nip) |
| 41 | if len(poolOfIntPools.pools) == 0 { |
| 42 | t.Fatalf("Pool did not get added to list when one should have been") |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | func TestIntPoolPoolReUse(t *testing.T) { |
| 47 | poolOfIntPools.pools = make([]*intPool, 0, poolDefaultCap) |