This commit is contained in:
Axlgrep 2025-07-11 12:41:37 -07:00 committed by GitHub
commit 44c80c9c9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 0 deletions

View File

@ -216,6 +216,19 @@ start_server {tags {"zset"}} {
set err
} {ERR*}
test "ZADD XX and INCR with existing elements - $encoding" {
r del ztmp
r zadd ztmp 10 x
assert {[r zadd ztmp xx incr 10 x] == 20}
}
test "ZADD XX and INCR with non-existing elements - $encoding" {
r del ztmp
r readraw 1
assert {[r zadd ztmp xx incr 10 x] == {$-1}}
r readraw 0
}
test "ZADD NX with non existing key - $encoding" {
r del ztmp
r zadd ztmp nx 10 x 20 y 30 z