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

Function TestIntMap

internal/utils/sync/map_int_test.go:14–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestIntMap(t *testing.T) {
15 var a = assert.NewAssertion(t)
16
17 var m = syncutils.NewIntMap[int, string]()
18 m.Put(1, "1")
19 a.IsTrue(m.Has(1))
20 a.IsFalse(m.Has(2))
21 m.Put(-1, "-1")
22 t.Log(m.Get(-1))
23 t.Log(m.Len(), "values")
24 {
25 a.IsTrue(m.Has(-1))
26 m.Delete(-1)
27 a.IsFalse(m.Has(-1))
28 }
29 t.Log(m.Len(), "values")
30}
31
32func TestInt64Map(t *testing.T) {
33 var a = assert.NewAssertion(t)

Callers

nothing calls this directly

Calls 6

LogMethod · 0.80
DeleteMethod · 0.65
PutMethod · 0.45
HasMethod · 0.45
GetMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected