(t *testing.T)
| 274 | } |
| 275 | |
| 276 | func TestIterCb(t *testing.T) { |
| 277 | slm := NewShardLockMaps() |
| 278 | |
| 279 | for i := 0; i < 100; i++ { |
| 280 | slm.Set(strconv.Itoa(i), TestUser{strconv.Itoa(i)}) |
| 281 | } |
| 282 | |
| 283 | counter := 0 |
| 284 | slm.IterCb(func(key string, v interface{}) { |
| 285 | _, ok := v.(TestUser) |
| 286 | if !ok { |
| 287 | t.Error("Expecting an user object") |
| 288 | } |
| 289 | |
| 290 | counter++ |
| 291 | }) |
| 292 | if counter != 100 { |
| 293 | t.Error("We should have counted 100 elements.") |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | func TestItems(t *testing.T) { |
| 298 | slm := NewShardLockMaps() |
nothing calls this directly
no test coverage detected