summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-10-13 21:58:21 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-10-13 21:59:24 +0200
commit7236fdb22f7fdb60833c32121b0828f11a13883c (patch)
tree3666e45a2d01e9e16e9343c82653a8ffde2b370b /tests
parent91504b6cbec2f555a3aa81113372c173adadad66 (diff)
downloadredis-7236fdb22f7fdb60833c32121b0828f11a13883c.tar.gz
Return error when min and/or max in the sorted set range spec is not a double
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/type/zset.tcl12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/type/zset.tcl b/tests/unit/type/zset.tcl
index 47c056073..6b8fc54ae 100644
--- a/tests/unit/type/zset.tcl
+++ b/tests/unit/type/zset.tcl
@@ -253,6 +253,12 @@ start_server {tags {"zset"}} {
assert_equal {d 3 c 2} [r zrevrangebyscore zset 5 2 LIMIT 2 3 WITHSCORES]
}
+ test "ZRANGEBYSCORE with non-value min or max" {
+ assert_error "*not a double*" {r zrangebyscore fooz str 1}
+ assert_error "*not a double*" {r zrangebyscore fooz 1 str}
+ assert_error "*not a double*" {r zrangebyscore fooz 1 NaN}
+ }
+
tags {"slow"} {
test {ZRANGEBYSCORE fuzzy test, 100 ranges in 1000 elements sorted set} {
set err {}
@@ -386,6 +392,12 @@ start_server {tags {"zset"}} {
assert_equal {a e} [r zrange zset 0 -1]
}
+ test "ZREMRANGEBYSCORE with non-value min or max" {
+ assert_error "*not a double*" {r zremrangebyscore fooz str 1}
+ assert_error "*not a double*" {r zremrangebyscore fooz 1 str}
+ assert_error "*not a double*" {r zremrangebyscore fooz 1 NaN}
+ }
+
test "ZREMRANGEBYRANK basics" {
proc remrangebyrank {min max} {
create_zset zset {1 a 2 b 3 c 4 d 5 e}