MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / TestMemoryList_Add

Function TestMemoryList_Add

internal/caches/list_memory_test.go:19–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestMemoryList_Add(t *testing.T) {
20 list := caches.NewMemoryList().(*caches.MemoryList)
21 _ = list.Init()
22 _ = list.Add("a", &caches.Item{
23 Key: "a1",
24 ExpiresAt: time.Now().Unix() + 3600,
25 HeaderSize: 1024,
26 })
27 _ = list.Add("b", &caches.Item{
28 Key: "b1",
29 ExpiresAt: time.Now().Unix() + 3600,
30 HeaderSize: 1024,
31 })
32 _ = list.Add("123456", &caches.Item{
33 Key: "c1",
34 ExpiresAt: time.Now().Unix() + 3600,
35 HeaderSize: 1024,
36 })
37 t.Log(list.Prefixes())
38 logs.PrintAsJSON(list.ItemMaps(), t)
39 t.Log(list.Count())
40}
41
42func TestMemoryList_Remove(t *testing.T) {
43 list := caches.NewMemoryList().(*caches.MemoryList)

Callers

nothing calls this directly

Calls 8

NewMemoryListFunction · 0.92
UnixMethod · 0.80
LogMethod · 0.80
PrefixesMethod · 0.80
ItemMapsMethod · 0.80
InitMethod · 0.65
AddMethod · 0.65
CountMethod · 0.65

Tested by

no test coverage detected