about summary refs log tree commit diff
path: root/Test/E01options.ztst
diff options
context:
space:
mode:
Diffstat (limited to 'Test/E01options.ztst')
-rw-r--r--Test/E01options.ztst20
1 files changed, 20 insertions, 0 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index 82b779850..da4020c15 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -975,6 +975,26 @@
 >
 ?fn: foo: parameter not set
 
+  fn() {
+    emulate -L zsh
+    setopt warncreateglobal
+    foo1=bar1
+    unset foo1
+    foo1=bar2
+    local foo2=bar3
+    unset foo2
+    foo2=bar4
+    typeset -g foo3
+    foo3=bar5
+    fn2() {
+      foo3=bar6
+    }
+  }
+  fn
+0:WARN_CREATE_GLOBAL option
+?fn:3: scalar parameter foo1 created globally in function
+?fn:5: scalar parameter foo1 created globally in function
+
 # This really just tests if XTRACE is egregiously broken.
 # To test it properly would need a full set of its own.
   fn() { print message; }