TestAsyncBufferReadAllCompability tests that ReadAll methods works as expected
(t *testing.T)
| 428 | |
| 429 | // TestAsyncBufferReadAllCompability tests that ReadAll methods works as expected |
| 430 | func TestAsyncBufferReadAllCompability(t *testing.T) { |
| 431 | source, err := os.ReadFile("../testdata/test1.jpg") |
| 432 | require.NoError(t, err) |
| 433 | ab := asyncbuffer.New(newCountingReader(bytes.NewReader(source)), -1) |
| 434 | defer ab.Close() |
| 435 | |
| 436 | b, err := io.ReadAll(ab.Reader()) |
| 437 | require.NoError(t, err) |
| 438 | require.Len(t, b, len(source)) |
| 439 | } |
| 440 | |
| 441 | func TestAsyncBufferThreshold(t *testing.T) { |
| 442 | _, bytesReader := generateSourceData(t, asyncbuffer.PauseThreshold*3) |
nothing calls this directly
no test coverage detected