diff options
author | Guy Benoish <guy.benoish@redislabs.com> | 2018-03-06 19:34:44 +0700 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-12-11 17:58:19 +0100 |
commit | 7c8cf5acdda6b727141653c89e96ad8707d0c5bd (patch) | |
tree | 51c3d0207d313802cdff290c05f9a6e5e8430010 /tests | |
parent | 39e9eda37741ae9c046758cf4660471a54f19981 (diff) | |
download | redis-7c8cf5acdda6b727141653c89e96ad8707d0c5bd.tar.gz |
Don't call sdscmp() with shared.maxstring or shared.minstring
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/type/zset.tcl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/unit/type/zset.tcl b/tests/unit/type/zset.tcl index cf54ae839..a8c817f6e 100644 --- a/tests/unit/type/zset.tcl +++ b/tests/unit/type/zset.tcl @@ -388,7 +388,7 @@ start_server {tags {"zset"}} { 0 omega} } - test "ZRANGEBYLEX/ZREVRANGEBYLEX/ZCOUNT basics" { + test "ZRANGEBYLEX/ZREVRANGEBYLEX/ZLEXCOUNT basics" { create_default_lex_zset # inclusive range @@ -416,6 +416,22 @@ start_server {tags {"zset"}} { assert_equal {} [r zrevrangebylex zset \[elez \[elex] assert_equal {} [r zrevrangebylex zset (hill (omega] } + + test "ZLEXCOUNT advanced" { + create_default_lex_zset + + assert_equal 9 [r zlexcount zset - +] + assert_equal 0 [r zlexcount zset + -] + assert_equal 0 [r zlexcount zset + \[c] + assert_equal 0 [r zlexcount zset \[c -] + assert_equal 8 [r zlexcount zset \[bar +] + assert_equal 5 [r zlexcount zset \[bar \[foo] + assert_equal 4 [r zlexcount zset \[bar (foo] + assert_equal 4 [r zlexcount zset (bar \[foo] + assert_equal 3 [r zlexcount zset (bar (foo] + assert_equal 5 [r zlexcount zset - (foo] + assert_equal 1 [r zlexcount zset (maxstring +] + } test "ZRANGEBYSLEX with LIMIT" { create_default_lex_zset |