Return error when min and/or max in the sorted set range spec is not a double

This commit is contained in:
Pieter Noordhuis
2010-10-13 21:58:21 +02:00
parent 91504b6cbe
commit 7236fdb22f
2 changed files with 30 additions and 7 deletions

View File

@ -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}