X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/36741b2c818a95e8ef167818271614ee6b1bc414..6dd1693c0e4bfae0ca0983b2a0bf70ae234a6bcb:/tests/unit/scripting.tcl?ds=sidebyside diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl index 05791871..8634263a 100644 --- a/tests/unit/scripting.tcl +++ b/tests/unit/scripting.tcl @@ -30,6 +30,10 @@ start_server {tags {"scripting"}} { set _ $e } {this is an error} + test {EVAL - Lua nil reply -> Redis protocol type conversion} { + r eval {return {1,redis.NIL,{nilbulk=true},4}} 0 + } {1 {} {} 4} + test {EVAL - Lua table -> Redis protocol type conversion} { r eval {return {1,2,3,'ciao',{1,2}}} 0 } {1 2 3 ciao {1 2}} @@ -344,5 +348,22 @@ start_server {tags {"scripting repl"}} { fail "Expected 2 in x, but value is '[r -1 get x]'" } } + + test {Replication of script multiple pushes to list with BLPOP} { + set rd [redis_deferring_client] + $rd brpop a 0 + r eval { + redis.call("lpush","a","1"); + redis.call("lpush","a","2"); + } 0 + set res [$rd read] + $rd close + wait_for_condition 50 100 { + [r -1 lrange a 0 -1] eq [r lrange a 0 -1] + } else { + fail "Expected list 'a' in slave and master to be the same, but they are respectively '[r -1 lrange a 0 -1]' and '[r lrange a 0 -1]'" + } + set res + } {a 1} } }