(t *testing.T)
| 128 | } |
| 129 | |
| 130 | func (s) TestBuffer_FreeAfterFree(t *testing.T) { |
| 131 | buf := newBuffer([]byte("abcd"), mem.NopBufferPool{}) |
| 132 | if buf.Len() != 4 { |
| 133 | t.Fatalf("Buffer length is %d, want 4", buf.Len()) |
| 134 | } |
| 135 | |
| 136 | // Ensure that a double free does panic. |
| 137 | buf.Free() |
| 138 | defer checkForPanic(t, "Cannot free freed buffer") |
| 139 | buf.Free() |
| 140 | } |
| 141 | |
| 142 | type singleBufferPool struct { |
| 143 | t *testing.T |
nothing calls this directly
no test coverage detected