From: antirez <antirez@gmail.com>
Date: Fri, 13 Apr 2012 11:40:57 +0000 (+0200)
Subject: Tests modified to match the new global protection implementation.
X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/d63a1716ebc8b6164287ee3ceed7c4bae0c49751?ds=inline

Tests modified to match the new global protection implementation.
---

diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl
index 091b4c43..a9aae7b8 100644
--- a/tests/unit/scripting.tcl
+++ b/tests/unit/scripting.tcl
@@ -223,39 +223,12 @@ start_server {tags {"scripting"}} {
     test {Globals protection reading an undeclared global variable} {
         catch {r eval {return a} 0} e
         set e
-    } {*ERR*global variable*not declared*}
+    } {*ERR*attempted to access unexisting global*}
 
-    test {Globals protection setting an undeclared global variable} {
+    test {Globals protection setting an undeclared global*} {
         catch {r eval {a=10} 0} e
         set e
-    } {*ERR*assignment to undeclared*}
-
-    test {Globals protection bypassed using 'global' function} {
-        catch {r eval {global("a"); a=10; return a} 0} e
-        set e
-    } {10}
-
-    test {Globals protection can be disabled} {
-        r config set lua-protect-globals no
-        catch {r eval {b=20; return b} 0} e
-        set e
-    } {20}
-
-    test {Globals protection can be re-enabled} {
-        r config set lua-protect-globals yes
-        catch {r eval {c=30; return c} 0} e
-        set e
-    } {*ERR*assignment to undeclared*}
-
-    test {Globals protection 'global' function works with mutliple args} {
-        catch {r eval {
-            global("var1","var2")
-            var1=10
-            var2=20
-            return {var1,var2}
-        } 0 } e
-        set e
-    } {10 20}
+    } {*ERR*attempted to create global*}
 }
 
 start_server {tags {"scripting repl"}} {