(ctx context.Context, t *testing.T, pc *cache.PersistentCache, key string, want []byte)
| 322 | } |
| 323 | |
| 324 | func verifyCached(ctx context.Context, t *testing.T, pc *cache.PersistentCache, key string, want []byte) { |
| 325 | t.Helper() |
| 326 | |
| 327 | var tmp gather.WriteBuffer |
| 328 | defer tmp.Close() |
| 329 | |
| 330 | if want == nil { |
| 331 | require.False(t, pc.TestingGetFull(ctx, key, &tmp)) |
| 332 | } else { |
| 333 | require.True(t, pc.TestingGetFull(ctx, key, &tmp)) |
| 334 | require.Equalf(t, want, tmp.ToByteSlice(), "invalid cached result for '%s'", key) |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | func verifyNotCached(ctx context.Context, t *testing.T, pc *cache.PersistentCache, key string) { |
| 339 | t.Helper() |
no test coverage detected