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

Function TestZero_Map

internal/zero/zero_test.go:25–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func TestZero_Map(t *testing.T) {
26 var stat1 = &runtime.MemStats{}
27 runtime.ReadMemStats(stat1)
28
29 var m = map[int]Zero{}
30 for i := 0; i < 1_000_000; i++ {
31 m[i] = New()
32 }
33
34 var stat2 = &runtime.MemStats{}
35 runtime.ReadMemStats(stat2)
36 t.Log((stat2.HeapInuse-stat1.HeapInuse)/1024/1024, "MB")
37 t.Log(len(m))
38
39 _, ok := m[1024]
40 t.Log(ok)
41}

Callers

nothing calls this directly

Calls 2

LogMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected