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

Function TestClear

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

Source from the content-addressed store, hash-verified

260}
261
262func TestClear(t *testing.T) {
263 slm := NewShardLockMaps()
264
265 for i := 0; i < 100; i++ {
266 slm.Set(strconv.Itoa(i), TestUser{strconv.Itoa(i)})
267 }
268
269 slm.Clear()
270
271 if slm.Count() != 0 {
272 t.Error("should have 0 elements.")
273 }
274}
275
276func TestIterCb(t *testing.T) {
277 slm := NewShardLockMaps()

Callers

nothing calls this directly

Calls 5

SetMethod · 0.95
ClearMethod · 0.95
CountMethod · 0.95
NewShardLockMapsFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected