Commit f54c2990 authored by BigCat's avatar BigCat
Browse files

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.
parent 706b32e0
...@@ -50,6 +50,10 @@ start_server { ...@@ -50,6 +50,10 @@ start_server {
assert_equal $result [r sort tosort BY weight_*] 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" { test "$title: SORT BY hash field" {
assert_equal $result [r sort tosort BY wobj_*->weight] assert_equal $result [r sort tosort BY wobj_*->weight]
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment