Commit b4eb9ccd authored by antirez's avatar antirez
Browse files

Merge branch 'hash-refactor' of git://github.com/pietern/redis

parents 58e1c9c1 b6f07345
This diff is collapsed.
......@@ -46,7 +46,7 @@ foreach redis_bulk_cmd {
# Flag commands requiring last argument as a bulk write operation
foreach redis_multibulk_cmd {
mset msetnx hset hmset hmget
mset msetnx hset hsetnx hmset hmget
} {
set ::redis::multibulkarg($redis_multibulk_cmd) {}
}
......
......@@ -1652,6 +1652,30 @@ proc main {} {
set _ $rv
} {0 newval1 1 0 newval2 1 1 1}
test {HSETNX target key missing - small hash} {
$r hsetnx smallhash __123123123__ foo
$r hget smallhash __123123123__
} {foo}
test {HSETNX target key exists - small hash} {
$r hsetnx smallhash __123123123__ bar
set result [$r hget smallhash __123123123__]
$r hdel smallhash __123123123__
set _ $result
} {foo}
test {HSETNX target key missing - big hash} {
$r hsetnx bighash __123123123__ foo
$r hget bighash __123123123__
} {foo}
test {HSETNX target key exists - big hash} {
$r hsetnx bighash __123123123__ bar
set result [$r hget bighash __123123123__]
$r hdel bighash __123123123__
set _ $result
} {foo}
test {HMSET wrong number of args} {
catch {$r hmset smallhash key1 val1 key2} err
format $err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment