From: BigCat <miaout17@gmail.com>
Date: Mon, 19 Dec 2011 11:45:57 +0000 (+0800)
Subject: I found that no test will fail even if I broke the `SORT x LIMIT y z` code.
X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/f54c299091e94ba69d298c1d782589c1e9903b9c?ds=inline

I found that no test will fail even if I broke the `SORT x LIMIT y z` code.
Added a naive unit test for SORT-LIMIT command.
---

diff --git a/tests/unit/sort.tcl b/tests/unit/sort.tcl
index e474e50c..d8f93e83 100644
--- a/tests/unit/sort.tcl
+++ b/tests/unit/sort.tcl
@@ -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]
         }