MCPcopy Index your code
hub / github.com/aceld/zinx / TestUnmarshalJSON

Function TestUnmarshalJSON

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

Source from the content-addressed store, hash-verified

326}
327
328func TestUnmarshalJSON(t *testing.T) {
329 slm := NewShardLockMaps()
330 bytes := []byte("{\"ccc\":1,\"ddd\":2}")
331
332 err := slm.UnmarshalJSON(bytes)
333 if err != nil {
334 t.Error(err)
335 }
336
337 if slm.Count() != 2 {
338 t.Error("Expecting count to be 2 once item was removed.")
339 }
340
341 for _, shard := range slm.shards {
342 fmt.Printf("%+v \n", shard.items)
343 }
344
345}
346
347func TestKeys(t *testing.T) {
348 slm := NewShardLockMaps()

Callers

nothing calls this directly

Calls 4

UnmarshalJSONMethod · 0.95
CountMethod · 0.95
NewShardLockMapsFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected