MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / TestSet

Function TestSet

internal/cache/cache_test.go:48–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestSet(t *testing.T) {
49 config.ConfigStore.Store(newTestRedisConfig(t))
50 ctx := context.Background()
51 mockCache, err := NewCache()
52 assert.NoError(t, err)
53
54 key := "testKey"
55 value := "testValue"
56
57 // Test setting a value
58 err = mockCache.Set(ctx, key, value, 10*time.Minute)
59 assert.NoError(t, err)
60
61 // Test setting a value with zero TTL (should fail or behave differently)
62 err = mockCache.Set(ctx, key, value, 0)
63 assert.NoError(t, err)
64}
65
66func TestGet(t *testing.T) {
67 config.ConfigStore.Store(newTestRedisConfig(t))

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
newTestRedisConfigFunction · 0.85
NewCacheFunction · 0.85

Tested by

no test coverage detected