| 228 | } |
| 229 | |
| 230 | func TestMget(t *testing.T) { |
| 231 | server.Clear() |
| 232 | c, err := proto.Dial(server.Addr()) |
| 233 | ok(t, err) |
| 234 | defer c.Close() |
| 235 | s := server.Direct() |
| 236 | |
| 237 | s.Set("zus", "jet") |
| 238 | s.Set("teun", "vuur") |
| 239 | s.Set("gijs", "lam") |
| 240 | s.Set("kees", "bok") |
| 241 | |
| 242 | mustDo(t, c, |
| 243 | "MGET", "zus", "nosuch", "kees", |
| 244 | proto.Array(proto.String("jet"), proto.Nil, proto.String("bok")), |
| 245 | ) |
| 246 | |
| 247 | // Wrong key type returns nil |
| 248 | { |
| 249 | s.HSet("aap", "foo", "bar") |
| 250 | mustDo(t, c, |
| 251 | "MGET", "aap", |
| 252 | proto.Array(proto.Nil), |
| 253 | ) |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | func TestMset(t *testing.T) { |
| 258 | server.Clear() |