MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / TestHashMget

Function TestHashMget

IceFireDB-PubSub/test/cmd_hash_test.go:339–372  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

337}
338
339func TestHashMget(t *testing.T) {
340 server.Clear()
341
342 c, err := proto.Dial(server.Addr())
343 ok(t, err)
344 defer c.Close()
345 directDo(t, c, "HSET", "wim", "zus", "jet")
346 directDo(t, c, "HSET", "wim", "teun", "vuur")
347 directDo(t, c, "HSET", "wim", "gijs", "lam")
348 directDo(t, c, "HSET", "wim", "kees", "bok")
349 mustDo(t, c,
350 "HMGET", "wim", "zus", "nosuch", "kees",
351 proto.Array(
352 proto.String("jet"),
353 proto.Nil,
354 proto.String("bok"),
355 ),
356 )
357
358 mustDo(t, c,
359 "HMGET", "nosuch", "zus", "kees",
360 proto.Array(
361 proto.Nil,
362 proto.Nil,
363 ),
364 )
365
366 // Wrong key type
367 directDo(t, c, "SET", "foo", "bar")
368 mustDo(t, c,
369 "HMGET", "foo", "bar",
370 proto.Error(msgWrongType),
371 )
372}
373
374func TestHashIncrby(t *testing.T) {
375 server.Clear()

Callers

nothing calls this directly

Calls 10

ClearFunction · 0.92
DialFunction · 0.92
AddrFunction · 0.92
ArrayFunction · 0.92
StringFunction · 0.92
ErrorFunction · 0.92
okFunction · 0.70
directDoFunction · 0.70
mustDoFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected