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

Function TestItems

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

Source from the content-addressed store, hash-verified

295}
296
297func TestItems(t *testing.T) {
298 slm := NewShardLockMaps()
299
300 for i := 0; i < 100; i++ {
301 slm.Set(strconv.Itoa(i), TestUser{strconv.Itoa(i)})
302 }
303
304 items := slm.Items()
305
306 if len(items) != 100 {
307 t.Error("We should have counted 100 elements.")
308 }
309
310}
311
312func TestJsonMarshal(t *testing.T) {
313 expected := "{\"a\":1,\"b\":2}"

Callers

nothing calls this directly

Calls 4

SetMethod · 0.95
ItemsMethod · 0.95
NewShardLockMapsFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected