Add generic function to grow an sds value

Move logic concerned with setting a bit in an sds to the SETBIT command
instead of keeping it in sds.c. The function to grow an sds can and will
be reused for a command to set a range within a string value.
This commit is contained in:
Pieter Noordhuis
2010-12-10 11:58:14 +01:00
parent 076f88d657
commit eae33c1c81
4 changed files with 42 additions and 39 deletions

View File

@ -416,10 +416,10 @@ start_server {tags {"basic"}} {
test "SETBIT with non-bit argument" {
r del mykey
assert_error "*0 or 1*" {r setbit mykey 0 -1}
assert_error "*0 or 1*" {r setbit mykey 0 2}
assert_error "*0 or 1*" {r setbit mykey 0 10}
assert_error "*0 or 1*" {r setbit mykey 0 01}
assert_error "*out of range*" {r setbit mykey 0 -1}
assert_error "*out of range*" {r setbit mykey 0 2}
assert_error "*out of range*" {r setbit mykey 0 10}
assert_error "*out of range*" {r setbit mykey 0 20}
}
test "GETBIT against non-existing key" {