(t *testing.T, cache cache.Cache, keys []string, chunks []chunkenc.Chunk)
| 41 | } |
| 42 | |
| 43 | func testCacheSingle(t *testing.T, cache cache.Cache, keys []string, chunks []chunkenc.Chunk) { |
| 44 | for range 100 { |
| 45 | index := rand.Intn(len(keys)) |
| 46 | key := keys[index] |
| 47 | |
| 48 | found, bufs, missingKeys := cache.Fetch(context.Background(), []string{key}) |
| 49 | require.Len(t, found, 1) |
| 50 | require.Len(t, bufs, 1) |
| 51 | require.Len(t, missingKeys, 0) |
| 52 | |
| 53 | c, err := chunkenc.FromData(chunkenc.EncXOR, bufs[0]) |
| 54 | require.NoError(t, err) |
| 55 | require.Equal(t, chunks[index], c) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | func testCacheMultiple(t *testing.T, cache cache.Cache, keys []string, chunks []chunkenc.Chunk) { |
| 60 | // test getting them all |
no test coverage detected