# Flag commands requiring last argument as a bulk write operation
foreach redis_bulk_cmd {
- set setnx rpush lpush lset lrem sadd srem sismember echo
+ set setnx rpush lpush lset lrem sadd srem sismember echo getset
} {
set ::redis::bulkarg($redis_bulk_cmd) {}
}
$r randomkey
} {}
+ test {GETSET (set new value)} {
+ list [$r getset foo xyz] [$r get foo]
+ } {{} xyz}
+
+ test {GETSET (replace old value)} {
+ $r set foo bar
+ list [$r getset foo xyz] [$r get foo]
+ } {bar xyz}
+
# Leave the user with a clean DB before to exit
test {FLUSHALL} {
$r flushall