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

Function TestNewIPCacheMap

internal/utils/agents/ip_cache_map_test.go:10–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestNewIPCacheMap(t *testing.T) {
11 var cacheMap = NewIPCacheMap(3)
12
13 t.Log("====")
14 cacheMap.Add("1")
15 cacheMap.Add("2")
16 logs.PrintAsJSON(cacheMap.m, t)
17 logs.PrintAsJSON(cacheMap.list, t)
18
19 t.Log("====")
20 cacheMap.Add("3")
21 logs.PrintAsJSON(cacheMap.m, t)
22 logs.PrintAsJSON(cacheMap.list, t)
23
24 t.Log("====")
25 cacheMap.Add("4")
26 logs.PrintAsJSON(cacheMap.m, t)
27 logs.PrintAsJSON(cacheMap.list, t)
28
29 t.Log("====")
30 cacheMap.Add("3")
31 logs.PrintAsJSON(cacheMap.m, t)
32 logs.PrintAsJSON(cacheMap.list, t)
33}

Callers

nothing calls this directly

Calls 3

NewIPCacheMapFunction · 0.85
LogMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected