MCPcopy
hub / github.com/gofiber/fiber / Test_Storage_Memory_SetWithContext

Function Test_Storage_Memory_SetWithContext

internal/storage/memory/memory_test.go:28–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func Test_Storage_Memory_SetWithContext(t *testing.T) {
29 t.Parallel()
30 var (
31 testStore = New()
32 key = "john"
33 val = []byte("doe")
34 )
35
36 ctx, cancel := context.WithCancel(context.Background())
37 cancel()
38
39 err := testStore.SetWithContext(ctx, key, val, 0)
40 require.ErrorIs(t, err, context.Canceled)
41
42 keys, err := testStore.Keys()
43 require.NoError(t, err)
44 require.Nil(t, keys)
45}
46
47func Test_Storage_Memory_Set_Override(t *testing.T) {
48 t.Parallel()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
SetWithContextMethod · 0.65
KeysMethod · 0.45

Tested by

no test coverage detected