(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestBodyCallbackReaderCountsReads(t *testing.T) { |
| 77 | br := NewByteBodyWithCallback([]byte{0x1, 0x2, 0x3, 0x4}, 4, nil) |
| 78 | |
| 79 | assert.EqualValues(t, 0, br.readSize) |
| 80 | |
| 81 | p := make([]byte, 8) |
| 82 | n, err := br.Read(p) |
| 83 | |
| 84 | assert.Equal(t, 4, n) |
| 85 | assert.Nil(t, err) |
| 86 | assert.EqualValues(t, 4, br.readSize) |
| 87 | } |
| 88 | |
| 89 | func TestBodyCallbackReaderUpdatesOffsetOnSeek(t *testing.T) { |
| 90 | br := NewByteBodyWithCallback([]byte{0x1, 0x2, 0x3, 0x4}, 4, nil) |
nothing calls this directly
no test coverage detected