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

Function TestKeysWhenRemoving

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

Source from the content-addressed store, hash-verified

372}
373
374func TestKeysWhenRemoving(t *testing.T) {
375 slm := NewShardLockMaps()
376
377 Total := 100
378 for i := 0; i < Total; i++ {
379 slm.Set(strconv.Itoa(i), TestUser{strconv.Itoa(i)})
380 }
381
382 Num := 10
383 for i := 0; i < Num; i++ {
384 go func(c *ShardLockMaps, n int) {
385 c.Remove(strconv.Itoa(n))
386 }(&slm, i)
387 }
388 keys := slm.Keys()
389 for _, k := range keys {
390 if k == "" {
391 t.Error("Empty keys returned")
392 }
393 }
394}
395
396func TestUnDrainedIterBuffered(t *testing.T) {
397 slm := NewShardLockMaps()

Callers

nothing calls this directly

Calls 5

SetMethod · 0.95
KeysMethod · 0.95
NewShardLockMapsFunction · 0.85
ErrorMethod · 0.80
RemoveMethod · 0.65

Tested by

no test coverage detected