diff --git a/src/sentinel.c b/src/sentinel.c index 9ea78aae5..f819af11a 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -4127,7 +4127,7 @@ numargserr: void addInfoSectionsToDict(dict *section_dict, char **sections); -/* SENTINEL INFO [section] */ +/* INFO [
[
...]] */ void sentinelInfoCommand(client *c) { char *sentinel_sections[] = {"server", "clients", "cpu", "stats", "sentinel", NULL}; int sec_all = 0, sec_everything = 0; diff --git a/src/server.c b/src/server.c index 01914dc50..95f32f83f 100644 --- a/src/server.c +++ b/src/server.c @@ -5917,6 +5917,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { return info; } +/* INFO [
[
...]] */ void infoCommand(client *c) { if (server.sentinel_mode) { sentinelInfoCommand(c); diff --git a/src/t_list.c b/src/t_list.c index 1cd3fb1a5..705da219c 100644 --- a/src/t_list.c +++ b/src/t_list.c @@ -679,7 +679,8 @@ void lposCommand(client *c) { return; if (rank == 0) { addReplyError(c,"RANK can't be zero: use 1 to start from " - "the first match, 2 from the second, ..."); + "the first match, 2 from the second ... " + "or use negative to start from the end of the list"); return; } } else if (!strcasecmp(opt,"COUNT") && moreargs) { @@ -1197,12 +1198,12 @@ void lmpopGenericCommand(client *c, int numkeys_idx, int is_block) { } } -/* LMPOP numkeys [ ...] LEFT|RIGHT [COUNT count] */ +/* LMPOP numkeys [ ...] (LEFT|RIGHT) [COUNT count] */ void lmpopCommand(client *c) { lmpopGenericCommand(c, 1, 0); } -/* BLMPOP timeout numkeys [ ...] LEFT|RIGHT [COUNT count] */ +/* BLMPOP timeout numkeys [ ...] (LEFT|RIGHT) [COUNT count] */ void blmpopCommand(client *c) { lmpopGenericCommand(c, 2, 1); } diff --git a/src/t_set.c b/src/t_set.c index 74afc6de2..3fb9f5259 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -805,7 +805,7 @@ void srandmemberWithCountCommand(client *c) { } } -/* SRANDMEMBER [] */ +/* SRANDMEMBER [] */ void srandmemberCommand(client *c) { robj *set; sds ele; @@ -850,7 +850,7 @@ int qsortCompareSetsByRevCardinality(const void *s1, const void *s2) { return 0; } -/* SINTER / SINTERSTORE / SINTERCARD +/* SINTER / SMEMBERS / SINTERSTORE / SINTERCARD * * 'cardinality_only' work for SINTERCARD, only return the cardinality * with minimum processing and memory overheads. diff --git a/tests/unit/type/list.tcl b/tests/unit/type/list.tcl index ecf23bdac..50870a041 100644 --- a/tests/unit/type/list.tcl +++ b/tests/unit/type/list.tcl @@ -389,12 +389,13 @@ start_server { assert {[r LPOS mylist c] == 2} } - test {LPOS RANK (positive and negative rank) option} { + test {LPOS RANK (positive, negative and zero rank) option} { assert {[r LPOS mylist c RANK 1] == 2} assert {[r LPOS mylist c RANK 2] == 6} assert {[r LPOS mylist c RANK 4] eq ""} assert {[r LPOS mylist c RANK -1] == 7} assert {[r LPOS mylist c RANK -2] == 6} + assert_error "*RANK can't be zero: use 1 to start from the first match, 2 from the second ... or use negative to start*" {r LPOS mylist c RANK 0} } test {LPOS COUNT option} {