(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func 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 | |
| 31 | func TestInt64KeyBasicOPs(t *testing.T) { |
| 32 | for i := 0; i < 10; i++ { |
nothing calls this directly
no test coverage detected