(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func TestSeek(t *testing.T) { |
| 125 | t.Parallel() |
| 126 | var it mockIterator |
| 127 | c := chunkIterator{ |
| 128 | chunk: GenericChunk{ |
| 129 | MaxTime: chunk.BatchSize, |
| 130 | }, |
| 131 | it: &it, |
| 132 | } |
| 133 | |
| 134 | for i := range chunk.BatchSize - 1 { |
| 135 | require.Equal(t, chunkenc.ValFloat, c.Seek(int64(i), 1)) |
| 136 | } |
| 137 | require.Equal(t, 1, it.seeks) |
| 138 | |
| 139 | require.Equal(t, chunkenc.ValFloat, c.Seek(int64(chunk.BatchSize), 1)) |
| 140 | require.Equal(t, 2, it.seeks) |
| 141 | } |
| 142 | |
| 143 | type mockIterator struct { |
| 144 | seeks int |