MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestMemoryList_Remove

Function TestMemoryList_Remove

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

Source from the content-addressed store, hash-verified

40}
41
42func TestMemoryList_Remove(t *testing.T) {
43 list := caches.NewMemoryList().(*caches.MemoryList)
44 _ = list.Init()
45 _ = list.Add("a", &caches.Item{
46 Key: "a1",
47 ExpiresAt: time.Now().Unix() + 3600,
48 HeaderSize: 1024,
49 })
50 _ = list.Add("b", &caches.Item{
51 Key: "b1",
52 ExpiresAt: time.Now().Unix() + 3600,
53 HeaderSize: 1024,
54 })
55 _ = list.Remove("b")
56 list.Print(t)
57 t.Log(list.Count())
58}
59
60func TestMemoryList_Purge(t *testing.T) {
61 list := caches.NewMemoryList().(*caches.MemoryList)

Callers

nothing calls this directly

Calls 8

NewMemoryListFunction · 0.92
UnixMethod · 0.80
LogMethod · 0.80
InitMethod · 0.65
AddMethod · 0.65
RemoveMethod · 0.65
CountMethod · 0.65
PrintMethod · 0.45

Tested by

no test coverage detected