| 216 | } |
| 217 | |
| 218 | func TestHashGetall(t *testing.T) { |
| 219 | server.Clear() |
| 220 | |
| 221 | c, err := proto.Dial(server.Addr()) |
| 222 | ok(t, err) |
| 223 | defer c.Close() |
| 224 | mustOK(t, c, "HMSET", "wim", |
| 225 | "gijs", "lam", |
| 226 | "kees", "bok", |
| 227 | "teun", "vuur", |
| 228 | "zus", "jet") |
| 229 | |
| 230 | mustDo(t, c, |
| 231 | "HGETALL", "wim", |
| 232 | proto.Strings( |
| 233 | "gijs", "lam", |
| 234 | "kees", "bok", |
| 235 | "teun", "vuur", |
| 236 | "zus", "jet", |
| 237 | ), |
| 238 | ) |
| 239 | |
| 240 | mustDo(t, c, "HGETALL", "nosuch", |
| 241 | proto.Strings(), |
| 242 | ) |
| 243 | |
| 244 | // Wrong key type |
| 245 | directDoString(t, c, "SET", "foo", "bar") |
| 246 | mustDo(t, c, "HGETALL", "foo", |
| 247 | proto.Error(msgWrongType), |
| 248 | ) |
| 249 | } |
| 250 | |
| 251 | func TestHashKeys(t *testing.T) { |
| 252 | server.Clear() |