| 197 | } |
| 198 | |
| 199 | func TestHashExists(t *testing.T) { |
| 200 | server.Clear() |
| 201 | |
| 202 | c, err := proto.Dial(server.Addr()) |
| 203 | ok(t, err) |
| 204 | defer c.Close() |
| 205 | must1(t, c, "HSET", "wim", "zus", "zus") |
| 206 | must1(t, c, "HEXISTS", "wim", "zus") |
| 207 | must0(t, c, "HEXISTS", "wim", "nosuch") |
| 208 | must0(t, c, "HEXISTS", "nosuch", "nosuch") |
| 209 | |
| 210 | // Wrong key type |
| 211 | directDoString(t, c, "SET", "foo", "bar") |
| 212 | mustDo(t, c, |
| 213 | "HEXISTS", "foo", "nosuch", |
| 214 | proto.Error(msgWrongType), |
| 215 | ) |
| 216 | } |
| 217 | |
| 218 | func TestHashGetall(t *testing.T) { |
| 219 | server.Clear() |