MCPcopy
hub / github.com/aceld/zinx / TestSet

Function TestSet

zutils/shard_lock_map_test.go:26–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestSet(t *testing.T) {
27 slm := NewShardLockMaps()
28
29 slm.Set("user", "14March")
30 mData := make(map[string]interface{})
31 mData["aaa"] = 111
32 mData["bbb"] = "222"
33 slm.MSet(mData)
34 slm.SetNX("user", "14March")
35 bo := TestUser{"bo"}
36 slm.SetNX("bo", bo)
37
38 if slm.Count() != 4 {
39 t.Error("shardLockMaps should contain exactly one elements.")
40 }
41
42}
43
44func TestGet(t *testing.T) {
45 slm := NewShardLockMaps()

Callers

nothing calls this directly

Calls 6

SetMethod · 0.95
MSetMethod · 0.95
SetNXMethod · 0.95
CountMethod · 0.95
NewShardLockMapsFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected