| 337 | } |
| 338 | |
| 339 | func 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 | |
| 374 | func TestHashIncrby(t *testing.T) { |
| 375 | server.Clear() |