wangjia184/sortedset

Invalid ranges should return empty but it isn't

Opened this issue · 0 comments

hbina commented

I believe the following test here should fail. But it succeeds.

checkRankRangeIterAndOrder(t, sortedset, -2, -3, true, []string{"g", "f"})

AFAIK, this library attempts to mirror the redis's ZSet behavior as shown:

hbina@akarin ~/g/radish (hbina-implement-zset-tests) [1]> redis-cli -p 6379
127.0.0.1:6379> FLUSHALL
OK
127.0.0.1:6379> ZADD key 1 a 2 b 3 c 4 d 5 f 6 g 7 h 8 i
(integer) 8
127.0.0.1:6379> ZRANGE key 0 -1
1) "a"
2) "b"
3) "c"
4) "d"
5) "f"
6) "g"
7) "h"
8) "i"
127.0.0.1:6379> ZRANGE key -2 -3
(empty array)
127.0.0.1:6379> ZRANGE key -2 -3 REV
(empty array)
127.0.0.1:6379>