(t *testing.T)
| 21 | } |
| 22 | |
| 23 | func TestPool(t *testing.T) { |
| 24 | pool := NewPool(func() Buffer { return New(10) }) |
| 25 | buf, err := pool.Get() |
| 26 | if err != nil { |
| 27 | t.Error(err) |
| 28 | } |
| 29 | buf.Write([]byte("hello world")) |
| 30 | pool.Put(buf) |
| 31 | } |
| 32 | |
| 33 | func TestMemPool(t *testing.T) { |
| 34 | p := NewMemPool(10) |