summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-11-14 17:10:48 +0100
committerantirez <antirez@gmail.com>2014-11-14 17:10:48 +0100
commit8a75ec0fca824f789f578bffdfc897c4df1b5d2b (patch)
treefed3cfee901ecd1220c5ecd358a882cc5b7e36f4 /tests
parentace628c7922221c0156f5469c85a938ebe4f6c4f (diff)
parenta2f929ab1095bae3812712a7ac63c8fa69ea15d5 (diff)
downloadredis-8a75ec0fca824f789f578bffdfc897c4df1b5d2b.tar.gz
Merge remote-tracking branch 'origin/unstable' into unstable
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/scripting.tcl19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl
index e103f903f..e1cd2174b 100644
--- a/tests/unit/scripting.tcl
+++ b/tests/unit/scripting.tcl
@@ -253,6 +253,25 @@ start_server {tags {"scripting"}} {
} 0
} {82a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a178c0 1 1}
+ test {EVAL - Numerical sanity check from bitop} {
+ r eval {assert(0x7fffffff == 2147483647, "broken hex literals");
+ assert(0xffffffff == -1 or 0xffffffff == 2^32-1,
+ "broken hex literals");
+ assert(tostring(-1) == "-1", "broken tostring()");
+ assert(tostring(0xffffffff) == "-1" or
+ tostring(0xffffffff) == "4294967295",
+ "broken tostring()")
+ } 0
+ } {}
+
+ test {EVAL - Verify minimal bitop functionality} {
+ r eval {assert(bit.tobit(1) == 1);
+ assert(bit.band(1) == 1);
+ assert(bit.bxor(1,2) == 3);
+ assert(bit.bor(1,2,4,8,16,32,64,128) == 255)
+ } 0
+ } {}
+
test {SCRIPTING FLUSH - is able to clear the scripts cache?} {
r set mykey myval
set v [r evalsha fd758d1589d044dd850a6f05d52f2eefd27f033f 1 mykey]