(t *testing.T)
| 137 | } |
| 138 | |
| 139 | func TestHashMSet(t *testing.T) { |
| 140 | server.Clear() |
| 141 | |
| 142 | c, err := proto.Dial(server.Addr()) |
| 143 | ok(t, err) |
| 144 | defer c.Close() |
| 145 | |
| 146 | // New Hash |
| 147 | { |
| 148 | mustOK(t, c, "HMSET", "hash", "wim", "zus", "jet", "vuur") |
| 149 | |
| 150 | equals(t, "zus", directDoString(t, c, "HGET", "hash", "wim")) |
| 151 | equals(t, "vuur", directDoString(t, c, "HGET", "hash", "jet")) |
| 152 | } |
| 153 | |
| 154 | // Doesn't touch ttl. |
| 155 | { |
| 156 | i, _ := directDoIntErr(t, c, "EXPIRE", "hash", 999) |
| 157 | equals(t, i, 1) |
| 158 | mustOK(t, c, "HMSET", "hash", "gijs", "lam") |
| 159 | time, err := directDoIntErr(t, c, "TTL", "hash") |
| 160 | |
| 161 | equals(t, 999, time) |
| 162 | equals(t, nil, err) |
| 163 | } |
| 164 | |
| 165 | { |
| 166 | // Wrong key type |
| 167 | directDoString(t, c, "SET", "str", "value") |
| 168 | mustDo(t, c, "HMSET", "str", "key", "value", proto.Error("WRONGTYPE Operation against a key holding the wrong kind of value")) |
| 169 | |
| 170 | // Usage error |
| 171 | mustDo(t, c, "HMSET", "str", proto.Error(errWrongNumber("HMSET"))) |
| 172 | mustDo(t, c, "HMSET", "str", "odd", proto.Error(errWrongNumber("HMSET"))) |
| 173 | mustDo(t, c, "HMSET", "str", "key", "value", "odd", proto.Error(errWrongNumber("HMSET"))) |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | func TestHashDel(t *testing.T) { |
| 178 | server.Clear() |
nothing calls this directly
no test coverage detected