]> git.saurik.com Git - redis.git/blobdiff - test-redis.tcl
Fixed a never experienced, theoretical bug that can actually happen in practice....
[redis.git] / test-redis.tcl
index 4a259d072cbef25442eaab4f13882defcc7c2dc7..7d529966cfdf00265e0343691ad6e064ca77dae8 100644 (file)
@@ -281,15 +281,20 @@ proc main {server port} {
     } [string repeat "abcd" 1000000]
 
     test {SET 10000 numeric keys and access all them in reverse order} {
+        set err {}
         for {set x 0} {$x < 10000} {incr x} {
             $r set $x $x
         }
         set sum 0
         for {set x 9999} {$x >= 0} {incr x -1} {
-            incr sum [$r get $x]
+            set val [$r get $x]
+            if {$val ne $x} {
+                set err "Eleemnt at position $x is $val instead of $x"
+                break
+            }
         }
-        format $sum
-    } {49995000}
+        set _ $err
+    } {}
 
     test {DBSIZE should be 10001 now} {
         $r dbsize
@@ -1562,6 +1567,18 @@ proc main {server port} {
         set _ 1
     } {1}
 
+    test {MUTLI / EXEC basics} {
+        $r del mylist
+        $r rpush mylist a
+        $r rpush mylist b
+        $r rpush mylist c
+        $r multi
+        set v1 [$r lrange mylist 0 -1]
+        set v2 [$r ping]
+        set v3 [$r exec]
+        list $v1 $v2 $v3
+    } {QUEUED QUEUED {{a b c} PONG}}
+
     # Leave the user with a clean DB before to exit
     test {FLUSHDB} {
         set aux {}