(t *testing.T, ctx context.Context, r *Reader)
| 212 | } |
| 213 | |
| 214 | func testReaderLag(t *testing.T, ctx context.Context, r *Reader) { |
| 215 | const N = 5 |
| 216 | prepareReader(t, ctx, r, makeTestSequence(N)...) |
| 217 | |
| 218 | if lag := r.Lag(); lag != 0 { |
| 219 | t.Errorf("the initial lag value is %d but was expected to be 0", lag) |
| 220 | } |
| 221 | |
| 222 | for i := 0; i != N; i++ { |
| 223 | r.ReadMessage(ctx) |
| 224 | expect := int64(N - (i + 1)) |
| 225 | |
| 226 | if lag := r.Lag(); lag != expect { |
| 227 | t.Errorf("the lag value at offset %d is %d but was expected to be %d", i, lag, expect) |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | func testReaderReadLag(t *testing.T, ctx context.Context, r *Reader) { |
| 233 | const N = 5 |
nothing calls this directly
no test coverage detected