]> git.saurik.com Git - redis.git/blobdiff - test-redis.tcl
Does not allow commands other than Pub/Sub commands when there is at least one pattern
[redis.git] / test-redis.tcl
index f45c473823c577a92a4b6d1e150a3ac513763edf..f321258a53783e0005c547fed66ce7664cfc81e5 100644 (file)
@@ -1671,6 +1671,46 @@ proc main {server port} {
         $r hmset bighash {*}$args
     } {OK}
 
+    test {HMGET against non existing key and fields} {
+        set rv {}
+        lappend rv [$r hmget doesntexist __123123123__ __456456456__]
+        lappend rv [$r hmget smallhash __123123123__ __456456456__]
+        lappend rv [$r hmget bighash __123123123__ __456456456__]
+        set _ $rv
+    } {{{} {}} {{} {}} {{} {}}}
+
+    test {HMGET - small hash} {
+        set keys {}
+        set vals {}
+        foreach {k v} [array get smallhash] {
+            lappend keys $k
+            lappend vals $v
+        }
+        set err {}
+        set result [$r hmget smallhash {*}$keys]
+        if {$vals ne $result} {
+            set err "$vals != $result"
+            break
+        }
+        set _ $err
+    } {}
+
+    test {HMGET - big hash} {
+        set keys {}
+        set vals {}
+        foreach {k v} [array get bighash] {
+            lappend keys $k
+            lappend vals $v
+        }
+        set err {}
+        set result [$r hmget bighash {*}$keys]
+        if {$vals ne $result} {
+            set err "$vals != $result"
+            break
+        }
+        set _ $err
+    } {}
+
     test {HKEYS - small hash} {
         lsort [$r hkeys smallhash]
     } [lsort [array names smallhash *]]