MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestSeek

Function TestSeek

pkg/querier/batch/chunk_test.go:124–141  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func 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
143type mockIterator struct {
144 seeks int

Callers

nothing calls this directly

Calls 2

SeekMethod · 0.95
EqualMethod · 0.65

Tested by

no test coverage detected