]> git.saurik.com Git - redis.git/commitdiff
I found that no test will fail even if I broke the `SORT x LIMIT y z` code.
authorBigCat <miaout17@gmail.com>
Mon, 19 Dec 2011 11:45:57 +0000 (19:45 +0800)
committerBigCat <miaout17@gmail.com>
Mon, 19 Dec 2011 11:49:34 +0000 (19:49 +0800)
Added a naive unit test for SORT-LIMIT command.

tests/unit/sort.tcl

index e474e50cf19557c1730388407a4edf877273a5ef..d8f93e83b9227289b24beb2a797a5f399418c6f5 100644 (file)
@@ -50,6 +50,10 @@ start_server {
             assert_equal $result [r sort tosort BY weight_*]
         }
 
+        test "$title: SORT BY key with limit" {
+            assert_equal [lrange $result 5 9] [r sort tosort BY weight_* LIMIT 5 5]
+        }
+
         test "$title: SORT BY hash field" {
             assert_equal $result [r sort tosort BY wobj_*->weight]
         }