(t *testing.T, cache cache.Cache, keys []string, bufs [][]byte)
| 47 | } |
| 48 | |
| 49 | func testCacheSingle(t *testing.T, cache cache.Cache, keys []string, bufs [][]byte) { |
| 50 | for i := 0; i < 100; i++ { |
| 51 | index := rand.Intn(len(keys)) |
| 52 | key := keys[index] |
| 53 | |
| 54 | found, foundBufs, missingKeys := cache.Fetch(context.Background(), []string{key}) |
| 55 | require.Len(t, found, 1) |
| 56 | require.Len(t, foundBufs, 1) |
| 57 | require.Len(t, missingKeys, 0) |
| 58 | require.Equal(t, bufs[index], foundBufs[0]) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | func testCacheMultiple(t *testing.T, cache cache.Cache, keys []string, bufs [][]byte) { |
| 63 | // test getting them all |
no test coverage detected