MCPcopy Create free account
hub / github.com/easierway/concurrent_map / TestBasicOPs

Function TestBasicOPs

concurrent_map_test.go:10–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestBasicOPs(t *testing.T) {
11 for i := 0; i < 10; i++ {
12 testV := rand.Intn(1000)
13 m := CreateConcurrentMap(99)
14 v, ok := m.Get(StrKey("Hello"))
15 if v != nil || ok != false {
16 t.Error("init/get failed")
17 }
18 m.Set(StrKey("Hello"), testV)
19 v, ok = m.Get(StrKey("Hello"))
20 if v.(int) != testV || ok != true {
21 t.Error("set/get failed.")
22 }
23 m.Del(StrKey("Hello"))
24 v, ok = m.Get(StrKey("Hello"))
25 if v != nil || ok != false {
26 t.Error("del failed")
27 }
28 }
29}
30
31func TestInt64KeyBasicOPs(t *testing.T) {
32 for i := 0; i < 10; i++ {

Callers

nothing calls this directly

Calls 5

CreateConcurrentMapFunction · 0.85
StrKeyFunction · 0.85
GetMethod · 0.65
SetMethod · 0.65
DelMethod · 0.65

Tested by

no test coverage detected