MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / cacheMissHelper

Function cacheMissHelper

cache/filesystem_cache_test.go:162–174  ·  view source on GitHub ↗

metatest used for both filesystem and redis Cache

(t *testing.T, c Cache)

Source from the content-addressed store, hash-verified

160
161// metatest used for both filesystem and redis Cache
162func cacheMissHelper(t *testing.T, c Cache) {
163 for i := 0; i < 10; i++ {
164 key := &Key{
165 Query: []byte(fmt.Sprintf("SELECT %d cache miss", i)),
166 }
167
168 _, err := c.Get(key)
169
170 if err != ErrMissing {
171 t.Fatalf("unexpected error: %s; expecting %s", err, ErrMissing)
172 }
173 }
174}
175
176func TestCacheClean(t *testing.T) {
177 cfg := config.Cache{

Callers 2

TestRedisCacheMissFunction · 0.85
TestFilesystemCacheMissFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected