Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ int getPositiveLongFromObjectOrReply(client *c, robj *o, long *target, const cha
if (msg) {
return getRangeLongFromObjectOrReply(c, o, 0, LONG_MAX, target, msg);
} else {
return getRangeLongFromObjectOrReply(c, o, 0, LONG_MAX, target, "value is out of range, must be positive");
return getRangeLongFromObjectOrReply(c, o, 0, LONG_MAX, target, "value is out of range, must be non-negative");
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/type/zset.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -1138,13 +1138,13 @@ start_server {tags {"zset"}} {

test "$pop with negative count" {
r set zset foo
assert_error "ERR *must be positive" {r $pop zset -1}
assert_error "ERR *must be non-negative" {r $pop zset -1}

r del zset
assert_error "ERR *must be positive" {r $pop zset -2}
assert_error "ERR *must be non-negative" {r $pop zset -2}

r zadd zset 1 a 2 b 3 c
assert_error "ERR *must be positive" {r $pop zset -3}
assert_error "ERR *must be non-negative" {r $pop zset -3}
}
}

Expand Down
Loading