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

Function TestInt64Map

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

Source from the content-addressed store, hash-verified

30}
31
32func TestInt64Map(t *testing.T) {
33 var a = assert.NewAssertion(t)
34
35 var m = syncutils.NewIntMap[int64, string]()
36 m.Put(1, "1")
37 a.IsTrue(m.Has(1))
38 a.IsFalse(m.Has(2))
39 m.Put(-1, "-1")
40 t.Log(m.Get(-1))
41 t.Log(m.Len(), "values")
42 {
43 a.IsTrue(m.Has(-1))
44 m.Delete(-1)
45 a.IsFalse(m.Has(-1))
46 }
47 m.Put(1024000000, "large int")
48 t.Log(m.Get(1024000000))
49 t.Log(m.Len(), "values")
50}
51
52func TestIntMap_PutCompact(t *testing.T) {
53 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