summary refs log tree commit diff
path: root/Test/B07emulate.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-10-11 20:14:01 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-10-11 20:14:01 +0000
commit4b86cc48f704152ccca13c50bc3acd59b4217ecc (patch)
treecfae43df67e766bd504da4a287a5e9307c931a60 /Test/B07emulate.ztst
parentad92cb3203e5d95be91019633e8f1f5835b12794 (diff)
downloadzsh-4b86cc48f704152ccca13c50bc3acd59b4217ecc.tar.gz
zsh-4b86cc48f704152ccca13c50bc3acd59b4217ecc.tar.xz
zsh-4b86cc48f704152ccca13c50bc3acd59b4217ecc.zip
30726: make shell options passed to emulate stick along with the emulation
Diffstat (limited to 'Test/B07emulate.ztst')
-rw-r--r--Test/B07emulate.ztst46
1 files changed, 46 insertions, 0 deletions
diff --git a/Test/B07emulate.ztst b/Test/B07emulate.ztst
index 569640bb4..315206a20 100644
--- a/Test/B07emulate.ztst
+++ b/Test/B07emulate.ztst
@@ -201,3 +201,49 @@
   emulate zsh -o fixallmybugs 'print This was executed, bad'
 1:emulate -c with incorrect options
 ?(eval):emulate:1: no such option: fixallmybugs
+
+  emulate zsh -c '
+    func() { [[ -o extendedglob ]] || print extendedglob is off }
+  '
+  func
+  emulate zsh -o extendedglob -c '
+    func() { [[ -o extendedglob ]] && print extendedglob is on }
+  '
+  func
+0:options specified alongside emulation are also sticky
+>extendedglob is off
+>extendedglob is on
+
+  emulate zsh -o extendedglob -c '
+    func_inner() { setopt nobareglobqual }
+  '
+  emulate zsh -o extendedglob -c '
+    func_outer() { 
+      func_inner
+      [[ -o bareglobqual ]] || print bareglobqual was turned off
+      [[ -o extendedglob ]] && print extendedglob is on, though
+    }
+  '
+  [[ -o extendedglob ]] || print extendedglob is initially off
+  func_outer
+0:options propagate between identical emulations
+>extendedglob is initially off
+>bareglobqual was turned off
+>extendedglob is on, though
+
+  emulate zsh -o extendedglob -c '
+    func_inner() { setopt nobareglobqual }
+  '
+  emulate zsh -o extendedglob -o cbases -c '
+    func_outer() { 
+      func_inner
+      [[ -o bareglobqual ]] && print bareglobqual is still on
+      [[ -o extendedglob ]] && print extendedglob is on, too
+    }
+  '
+  [[ -o extendedglob ]] || print extendedglob is initially off
+  func_outer
+0:options do not propagate between different emulations
+>extendedglob is initially off
+>bareglobqual is still on
+>extendedglob is on, too