MCPcopy
hub / github.com/docker/docker-agent / TestMemoryCache_overwrite

Function TestMemoryCache_overwrite

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

Source from the content-addressed store, hash-verified

76}
77
78func TestMemoryCache_overwrite(t *testing.T) {
79 t.Parallel()
80 c, err := New(Config{Enabled: true})
81 require.NoError(t, err)
82
83 c.Store("q", "first")
84 c.Store("q", "second")
85
86 got, ok := c.Lookup("q")
87 assert.True(t, ok)
88 assert.Equal(t, "second", got)
89}
90
91// TestFileCache_dedupSkipsRedundantWrite verifies that storing the exact
92// same (question, response) pair twice is treated as a no-op, so the

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
StoreMethod · 0.45
LookupMethod · 0.45

Tested by

no test coverage detected