| 292 | } |
| 293 | |
| 294 | func TestHashValues(t *testing.T) { |
| 295 | server.Clear() |
| 296 | c, err := proto.Dial(server.Addr()) |
| 297 | ok(t, err) |
| 298 | defer c.Close() |
| 299 | directDo(t, c, "HSET", "wim", "zus", "jet") |
| 300 | directDo(t, c, "HSET", "wim", "teun", "vuur") |
| 301 | directDo(t, c, "HSET", "wim", "gijs", "lam") |
| 302 | directDo(t, c, "HSET", "wim", "kees", "bok") |
| 303 | mustDo(t, c, "HVALS", "wim", |
| 304 | proto.Strings( |
| 305 | "bok", |
| 306 | "jet", |
| 307 | "lam", |
| 308 | "vuur", |
| 309 | ), |
| 310 | ) |
| 311 | |
| 312 | mustDo(t, c, "HVALS", "nosuch", proto.Strings()) |
| 313 | |
| 314 | // Wrong key type |
| 315 | directDo(t, c, "SET", "foo", "bar") |
| 316 | mustDo(t, c, "HVALS", "foo", proto.Error(msgWrongType)) |
| 317 | } |
| 318 | |
| 319 | func TestHashLen(t *testing.T) { |
| 320 | server.Clear() |