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

Function TestList_Add

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

Source from the content-addressed store, hash-verified

15)
16
17func TestList_Add(t *testing.T) {
18 var list = expires.NewList()
19 list.Add(1, time.Now().Unix())
20 t.Log("===BEFORE===")
21 logs.PrintAsJSON(list.ExpireMap(), t)
22 logs.PrintAsJSON(list.ItemsMap(), t)
23
24 list.Add(1, time.Now().Unix()+1)
25 list.Add(2, time.Now().Unix()+1)
26 list.Add(3, time.Now().Unix()+2)
27 t.Log("===AFTER===")
28 logs.PrintAsJSON(list.ExpireMap(), t)
29 logs.PrintAsJSON(list.ItemsMap(), t)
30}
31
32func TestList_Add_Overwrite(t *testing.T) {
33 var timestamp = time.Now().Unix()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected