INCRBY/DECRBY now support 64bit increments, with tests

This commit is contained in:
antirez
2009-04-27 17:50:26 +02:00
parent f5785ae997
commit d68ed1201a
4 changed files with 21 additions and 4 deletions

View File

@ -101,6 +101,21 @@ proc main {server port} {
$r incr novar
} {101}
test {INCR over 32bit value} {
$r set novar 17179869184
$r incr novar
} {17179869185}
test {INCRBY over 32bit value with over 32bit increment} {
$r set novar 17179869184
$r incrby novar 17179869184
} {34359738368}
test {DECRBY over 32bit value with over 32bit increment, negative res} {
$r set novar 17179869184
$r decrby novar 17179869185
} {-1}
test {SETNX target key missing} {
$r setnx novar2 foobared
$r get novar2