MCPcopy Create free account
hub / github.com/allegro/bigcache / TestWriteAndGetOnCache

Function TestWriteAndGetOnCache

bigcache_test.go:16–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestWriteAndGetOnCache(t *testing.T) {
17 t.Parallel()
18
19 // given
20 cache, _ := New(context.Background(), DefaultConfig(5*time.Second))
21 value := []byte("value")
22
23 // when
24 cache.Set("key", value)
25 cachedValue, err := cache.Get("key")
26
27 // then
28 noError(t, err)
29 assertEqual(t, value, cachedValue)
30}
31
32func TestAppendAndGetOnCache(t *testing.T) {
33 t.Parallel()

Callers

nothing calls this directly

Calls 6

NewFunction · 0.85
DefaultConfigFunction · 0.85
SetMethod · 0.80
noErrorFunction · 0.70
assertEqualFunction · 0.70
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…