MCPcopy
hub / github.com/nextlevelbuilder/goclaw / TestInMemoryCache_Delete

Function TestInMemoryCache_Delete

internal/cache/memory_test.go:43–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

41}
42
43func TestInMemoryCache_Delete(t *testing.T) {
44 c := NewInMemoryCache[string]()
45 ctx := context.Background()
46
47 c.Set(ctx, "k", "v", 0)
48 c.Delete(ctx, "k")
49
50 _, ok := c.Get(ctx, "k")
51 if ok {
52 t.Fatal("expected key to be deleted")
53 }
54}
55
56func TestInMemoryCache_DeleteByPrefix(t *testing.T) {
57 c := NewInMemoryCache[string]()

Callers

nothing calls this directly

Calls 3

SetMethod · 0.65
DeleteMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected