mirror of
http://github.com/valkey-io/valkey
synced 2024-11-23 03:33:28 +00:00
more tests in test-redis.tcl, some minor fix
This commit is contained in:
parent
a5eb649bfa
commit
0b13687c25
2
TODO
2
TODO
@ -7,8 +7,6 @@ Most of the features already implemented for this release. The following is a li
|
||||
|
||||
* Man pages for SRANDMEMBER, missing Z-commands, ...
|
||||
* Write docs for the "STORE" operaiton of SORT. Link to the article about SORT by written by defunkt.
|
||||
* ZRANGEBYSCORE LIMIT option and test.
|
||||
* check the command table for deny on OOM correctness.
|
||||
|
||||
VERSION 1.4 TODO (Hash type)
|
||||
============================
|
||||
|
3
redis.c
3
redis.c
@ -501,7 +501,7 @@ static struct redisCommand cmdTable[] = {
|
||||
{"lrange",lrangeCommand,4,REDIS_CMD_INLINE},
|
||||
{"ltrim",ltrimCommand,4,REDIS_CMD_INLINE},
|
||||
{"lrem",lremCommand,4,REDIS_CMD_BULK},
|
||||
{"rpoplpush",rpoplpushcommand,3,REDIS_CMD_BULK},
|
||||
{"rpoplpush",rpoplpushcommand,3,REDIS_CMD_BULK|REDIS_CMD_DENYOOM},
|
||||
{"sadd",saddCommand,3,REDIS_CMD_BULK|REDIS_CMD_DENYOOM},
|
||||
{"srem",sremCommand,3,REDIS_CMD_BULK},
|
||||
{"smove",smoveCommand,4,REDIS_CMD_BULK},
|
||||
@ -4570,6 +4570,7 @@ static void zrangebyscoreCommand(redisClient *c) {
|
||||
} else if (c->argc == 7) {
|
||||
offset = atoi(c->argv[5]->ptr);
|
||||
limit = atoi(c->argv[6]->ptr);
|
||||
if (offset < 0) offset = 0;
|
||||
}
|
||||
|
||||
o = lookupKeyRead(c->db,c->argv[1]);
|
||||
|
@ -1063,6 +1063,30 @@ proc main {server port} {
|
||||
set _ $err
|
||||
} {}
|
||||
|
||||
test {ZRANGEBYSCORE with LIMIT} {
|
||||
$r del zset
|
||||
$r zadd zset 1 a
|
||||
$r zadd zset 2 b
|
||||
$r zadd zset 3 c
|
||||
$r zadd zset 4 d
|
||||
$r zadd zset 5 e
|
||||
list \
|
||||
[$r zrangebyscore zset 0 10 LIMIT 0 2] \
|
||||
[$r zrangebyscore zset 0 10 LIMIT 2 3] \
|
||||
[$r zrangebyscore zset 0 10 LIMIT 2 10] \
|
||||
[$r zrangebyscore zset 0 10 LIMIT 20 10]
|
||||
} {{a b} {c d e} {c d e} {}}
|
||||
|
||||
test {SORT against sorted sets} {
|
||||
$r del zset
|
||||
$r zadd zset 1 a
|
||||
$r zadd zset 5 b
|
||||
$r zadd zset 2 c
|
||||
$r zadd zset 10 d
|
||||
$r zadd zset 3 e
|
||||
$r sort zset alpha desc
|
||||
} {e d c b a}
|
||||
|
||||
test {Sorted sets +inf and -inf handling} {
|
||||
$r del zset
|
||||
$r zadd zset -100 a
|
||||
|
Loading…
Reference in New Issue
Block a user