sortedset
sortedset copied to clipboard
Invalid ranges should return empty but it isn't
I believe the following test here should fail. But it succeeds.
https://github.com/wangjia184/sortedset/blob/af6d6d227aa79e2a64b899d995ce18aa0bef437c/sortedset_test.go#L98
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>