]> git.saurik.com Git - redis.git/blobdiff - test-redis.tcl
Merge branch 'hmget' of git://github.com/pietern/redis
[redis.git] / test-redis.tcl
index 6ebcb039f15f9f18bbfc94f4754ce6c26705bd6d..f321258a53783e0005c547fed66ce7664cfc81e5 100644 (file)
@@ -234,7 +234,7 @@ proc main {server port} {
 
     # The following AUTH test should be enabled only when requirepass
     # <PASSWORD> is set in redis.conf and redis-server was started with
-    # redis.conf as the first argument.  
+    # redis.conf as the first argument.
 
     #test {AUTH with requirepass in redis.conf} {
     #    $r auth foobared
@@ -359,10 +359,18 @@ proc main {server port} {
         $r incrby novar 17179869184
     } {34359738368}
 
-    test {INCR against key with spaces (no integer encoded)} {
+    test {INCR fails against key with spaces (no integer encoded)} {
         $r set novar "    11    "
-        $r incr novar
-    } {12}
+        catch {$r incr novar} err
+        format $err
+    } {ERR*}
+
+    test {INCR fails against a key holding a list} {
+        $r rpush mylist 1
+        catch {$r incr novar} err
+        $r rpop mylist
+        format $err
+    } {ERR*}
 
     test {DECRBY over 32bit value with over 32bit increment, negative res} {
         $r set novar 17179869184
@@ -831,7 +839,7 @@ proc main {server port} {
     test {SUNION with two sets} {
         lsort [$r sunion set1 set2]
     } [lsort -uniq "[$r smembers set1] [$r smembers set2]"]
-    
+
     test {SINTERSTORE with two sets} {
         $r sinterstore setres set1 set2
         lsort [$r smembers setres]
@@ -902,9 +910,9 @@ proc main {server port} {
         $r lpush mysavelist world
         $r set myemptykey {}
         $r set mynormalkey {blablablba}
-        $r zadd mytestzset a 10
-        $r zadd mytestzset b 20
-        $r zadd mytestzset c 30
+        $r zadd mytestzset 10 a
+        $r zadd mytestzset 20 b
+        $r zadd mytestzset 30 c
         $r save
     } {OK}
 
@@ -920,7 +928,7 @@ proc main {server port} {
         }
         lsort [array names myset]
     } {a b c}
-    
+
     test {Create a random list and a random set} {
         set tosort {}
         array set seenrand {}