(pool PoolAt, t *testing.T)
| 834 | } |
| 835 | |
| 836 | func poolAtTest(pool PoolAt, t *testing.T) { |
| 837 | buf, err := pool.Get() |
| 838 | if err != nil { |
| 839 | t.Error(err) |
| 840 | } |
| 841 | if n, err := buf.Write([]byte("hello world")); n != 10 { |
| 842 | t.Errorf("wrote incorrect amount") |
| 843 | } else if err == nil { |
| 844 | t.Errorf("should have been a shortwrite error here") |
| 845 | } |
| 846 | pool.Put(buf) |
| 847 | if buf.Len() > 0 { |
| 848 | t.Errorf("should have emptied the buffer") |
| 849 | } |
| 850 | } |
| 851 | |
| 852 | func TestPartitionAt(t *testing.T) { |
| 853 | buf := NewPartitionAt(NewMemPoolAt(5)) |
no test coverage detected
searching dependent graphs…