r incrby novar 17179869184
} {34359738368}
- test {INCR fails against key with spaces (no integer encoded)} {
+ test {INCR fails against key with spaces (left)} {
+ r set novar " 11"
+ catch {r incr novar} err
+ format $err
+ } {ERR*}
+
+ test {INCR fails against key with spaces (right)} {
+ r set novar "11 "
+ catch {r incr novar} err
+ format $err
+ } {ERR*}
+
+ test {INCR fails against key with spaces (both)} {
r set novar " 11 "
catch {r incr novar} err
format $err
test {INCRBYFLOAT against non existing key} {
r del novar
- list [r incrbyfloat novar 1] [r get novar] [r incrbyfloat novar 0.25] \
- [r get novar]
+ list [roundFloat [r incrbyfloat novar 1]] \
+ [roundFloat [r get novar]] \
+ [roundFloat [r incrbyfloat novar 0.25]] \
+ [roundFloat [r get novar]]
} {1 1 1.25 1.25}
test {INCRBYFLOAT against key originally set with SET} {
r set novar 1.5
- r incrbyfloat novar 1.5
+ roundFloat [r incrbyfloat novar 1.5]
} {3}
test {INCRBYFLOAT over 32bit value} {
test {INCRBYFLOAT decrement} {
r set foo 1
- r incrbyfloat foo -1.256
- } {-0.256}
+ roundFloat [r incrbyfloat foo -1.1]
+ } {-0.1}
test "SETNX target key missing" {
r del novar