about summary refs log tree commit diff
path: root/Test/E01options.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-08-08 17:19:57 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-08-08 17:19:57 +0000
commit6c79be71af8fa721348255dfd799336c956e9954 (patch)
tree2f4aa1e3324fe44e2d2cfd097d972753c84d62ba /Test/E01options.ztst
parent5587d05958c02913c47ce53b0e3636aa8e1fa88f (diff)
downloadzsh-6c79be71af8fa721348255dfd799336c956e9954.tar.gz
zsh-6c79be71af8fa721348255dfd799336c956e9954.tar.xz
zsh-6c79be71af8fa721348255dfd799336c956e9954.zip
21576: test for 21575
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; }