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

Function TestMemoryCache_trimSpaces

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

Source from the content-addressed store, hash-verified

49}
50
51func TestMemoryCache_trimSpaces(t *testing.T) {
52 t.Parallel()
53 c, err := New(Config{Enabled: true, TrimSpaces: true})
54 require.NoError(t, err)
55
56 c.Store(" hello ", "world")
57
58 got, ok := c.Lookup("hello")
59 assert.True(t, ok)
60 assert.Equal(t, "world", got)
61
62 got, ok = c.Lookup("\thello\n")
63 assert.True(t, ok)
64 assert.Equal(t, "world", got)
65}
66
67func TestMemoryCache_noTrimByDefault(t *testing.T) {
68 t.Parallel()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
StoreMethod · 0.45
LookupMethod · 0.45

Tested by

no test coverage detected