MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestCacheKeyDeterministic

Function TestCacheKeyDeterministic

cmd/cache-proxy/cache_test.go:80–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

78 if !d.read {
79 d.read = true
80 return d.entries, nil
81 }
82 return nil, d.err
83}
84
85func (d *scriptedCacheDirectory) Close() error { return nil }
86
87func TestIsValidCacheKey(t *testing.T) {
88 cases := []struct {
89 key string
90 want bool
91 }{
92 {strings.Repeat("a", 64), true},
93 {strings.Repeat("f", 64), true},
94 {"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", true},
95 // Wrong length.
96 {strings.Repeat("a", 63), false},

Callers

nothing calls this directly

Calls 2

CacheKeyFunction · 0.85
IsValidCacheKeyFunction · 0.85

Tested by

no test coverage detected