From 7864ef855181016993a87d0d57f7814e7fc9980b Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 27 Sep 2011 15:39:41 +0200 Subject: [PATCH] new tests for the scripting engine: not allowed commands and write commands after random commands. --- tests/unit/scripting.tcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl index 15ea0d5ae..d8a2e023e 100644 --- a/tests/unit/scripting.tcl +++ b/tests/unit/scripting.tcl @@ -123,6 +123,21 @@ start_server {tags {"scripting"}} { } e set _ $e } {*execution time*} + + test {EVAL - Scripts can't run certain commands} { + set e {} + catch {r eval {return redis.call('spop','x')} 0} e + set e + } {*not allowed*} + + test {EVAL - Scripts can't run certain commands} { + set e {} + catch { + r eval "redis.call('randomkey'); return redis.call('set','x','ciao')" 0 + } e + set e + } {*not allowed after*} + } start_server {tags {"scripting repl"}} {