]> git.saurik.com Git - redis.git/commitdiff
Test: regression for issue #801.
authorantirez <antirez@gmail.com>
Sat, 1 Dec 2012 22:07:09 +0000 (23:07 +0100)
committerantirez <antirez@gmail.com>
Sun, 2 Dec 2012 19:43:11 +0000 (20:43 +0100)
tests/unit/type/list.tcl

index 642762cff561ddf1df1a58241aad42ada38ac926..e665afc0a14a943fe870175030aabf36af21f9cb 100644 (file)
@@ -190,6 +190,27 @@ start_server {
         $rd read
     } {list b}
 
+    test "BLPOP with same key multiple times should work (issue #801)" {
+        set rd [redis_deferring_client]
+        r del list1 list2
+
+        # Data arriving after the BLPOP.
+        $rd blpop list1 list2 list2 list1 0
+        r lpush list1 a
+        assert_equal [$rd read] {list1 a}
+        $rd blpop list1 list2 list2 list1 0
+        r lpush list2 b
+        assert_equal [$rd read] {list2 b}
+
+        # Data already there.
+        r lpush list1 a
+        r lpush list2 b
+        $rd blpop list1 list2 list2 list1 0
+        assert_equal [$rd read] {list1 a}
+        $rd blpop list1 list2 list2 list1 0
+        assert_equal [$rd read] {list2 b}
+    }
+
     test "MULTI/EXEC is isolated from the point of view of BLPOP" {
         set rd [redis_deferring_client]
         r del list