]> git.saurik.com Git - redis.git/commitdiff
new tests for the scripting engine: not allowed commands and write commands after...
authorantirez <antirez@gmail.com>
Tue, 27 Sep 2011 13:39:41 +0000 (15:39 +0200)
committerantirez <antirez@gmail.com>
Tue, 27 Sep 2011 13:39:41 +0000 (15:39 +0200)
tests/unit/scripting.tcl

index 15ea0d5ae9830912bd9458651df181dbb8f884ae..d8a2e023e2216ab664951dabae628ab15d8da211 100644 (file)
@@ -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"}} {