(t *testing.T)
| 11 | var testBufLength = 10 |
| 12 | |
| 13 | func TestReadAllWithEstimate(t *testing.T) { |
| 14 | buf := make([]byte, testBufLength) |
| 15 | _, err := rand.Read(buf) |
| 16 | assert.NoError(t, err) |
| 17 | assert.Equal(t, testBufLength, len(buf)) |
| 18 | assert.Equal(t, testBufLength, cap(buf)) |
| 19 | |
| 20 | actualBuf, err := ReadAllWithEstimate(bytes.NewReader(buf), int64(testBufLength)) |
| 21 | assert.NoError(t, err) |
| 22 | assert.Equal(t, buf, actualBuf) |
| 23 | assert.Equal(t, testBufLength, len(actualBuf)) |
| 24 | assert.Equal(t, testBufLength+1, cap(actualBuf)) // one extra byte used in ReadAllWithEstimate |
| 25 | } |
nothing calls this directly
no test coverage detected