X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/d866803818fb47a851e5730ccff634f993ce6f68..5513397de7526f0e5e01c1d29a37813008703d6d:/tests/unit/bitops.tcl diff --git a/tests/unit/bitops.tcl b/tests/unit/bitops.tcl index c8f58ef1..dade8923 100644 --- a/tests/unit/bitops.tcl +++ b/tests/unit/bitops.tcl @@ -73,6 +73,17 @@ start_server {tags {"bitops"}} { set e } {ERR*syntax*} + test {BITCOUNT regression test for github issue #582} { + r del str + r setbit foo 0 1 + if {[catch {r bitcount foo 0 4294967296} e]} { + assert_match {*ERR*out of range*} $e + set _ 1 + } else { + set e + } + } {1} + test {BITOP NOT (empty string)} { r set s "" r bitop not dest s @@ -159,5 +170,11 @@ start_server {tags {"bitops"}} { r lpush c foo catch {r bitop xor dest a b c d} e set e - } {*ERR*} + } {WRONGTYPE*} + + test {BITOP with empty string after non empty string (issue #529)} { + r flushdb + r set a "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + r bitop or x a b + } {32} }