(t *testing.T)
| 24 | } |
| 25 | |
| 26 | func 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 | |
| 44 | func TestGet(t *testing.T) { |
| 45 | slm := NewShardLockMaps() |