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

Function TestList_Remove

internal/utils/expires/list_test.go:49–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestList_Remove(t *testing.T) {
50 var a = assert.NewAssertion(t)
51
52 var list = expires.NewList()
53 list.Add(1, time.Now().Unix()+1)
54 list.Remove(1)
55 logs.PrintAsJSON(list.ExpireMap(), t)
56 logs.PrintAsJSON(list.ItemsMap(), t)
57
58 a.IsTrue(len(list.ExpireMap()) == 0)
59 a.IsTrue(len(list.ItemsMap()) == 0)
60}
61
62func TestList_GC(t *testing.T) {
63 var unixTime = time.Now().Unix()

Callers

nothing calls this directly

Calls 6

NewListFunction · 0.92
UnixMethod · 0.80
ExpireMapMethod · 0.80
AddMethod · 0.65
RemoveMethod · 0.65
ItemsMapMethod · 0.45

Tested by

no test coverage detected