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

Function newTestCache

cmd/cache-proxy/cache_test.go:96–103  ·  view source on GitHub ↗

newTestCache creates a DiskCache backed by t.TempDir() for isolation.

(t *testing.T)

Source from the content-addressed store, hash-verified

94 {"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", true},
95 // Wrong length.
96 {strings.Repeat("a", 63), false},
97 {strings.Repeat("a", 65), false},
98 {"", false},
99 // Upper-case — CacheKey uses %x (lowercase); reject upper.
100 {strings.Repeat("A", 64), false},
101 // Path traversal attempts.
102 {"../../etc/passwd", false},
103 {strings.Repeat("a", 60) + "/../x", false},
104 // Non-hex chars.
105 {strings.Repeat("g", 64), false},
106 {strings.Repeat("z", 64), false},

Callers 10

newTestProxyFunction · 0.85
TestDiskCachePutGetHasFunction · 0.85
TestDiskCacheOpenFunction · 0.85
TestDiskCacheEvictionFunction · 0.85
TestPutStreamRoundTripFunction · 0.85
TestPutStreamOverwriteFunction · 0.85

Calls 1

NewDiskCacheFunction · 0.85

Tested by

no test coverage detected