MCPcopy Index your code
hub / github.com/docker/docker-agent / TestMemoryCache_caseSensitiveDefault

Function TestMemoryCache_caseSensitiveDefault

pkg/cache/cache_test.go:23–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestMemoryCache_caseSensitiveDefault(t *testing.T) {
24 t.Parallel()
25 c, err := New(Config{Enabled: true, CaseSensitive: true})
26 require.NoError(t, err)
27 require.NotNil(t, c)
28
29 c.Store("Hello", "world")
30
31 got, ok := c.Lookup("Hello")
32 assert.True(t, ok)
33 assert.Equal(t, "world", got)
34
35 _, ok = c.Lookup("hello")
36 assert.False(t, ok, "case-sensitive cache should not match different case")
37}
38
39func TestMemoryCache_caseInsensitive(t *testing.T) {
40 t.Parallel()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
StoreMethod · 0.45
LookupMethod · 0.45

Tested by

no test coverage detected