about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-04-26 09:44:38 +0100
committerPeter Stephenson <pws@zsh.org>2017-04-26 09:44:38 +0100
commit408b92b168078a338f5fc2c2f95f39f8aa8e5f67 (patch)
treee77e749ecc39de774bfab18e4acfe6adeac9d593 /Test
parentd78b02218eb64aa117f883716d0e039e8604081e (diff)
downloadzsh-408b92b168078a338f5fc2c2f95f39f8aa8e5f67.tar.gz
zsh-408b92b168078a338f5fc2c2f95f39f8aa8e5f67.tar.xz
zsh-408b92b168078a338f5fc2c2f95f39f8aa8e5f67.zip
41008: Handle expansions for precommand modifiers
Diffstat (limited to 'Test')
-rw-r--r--Test/A01grammar.ztst22
-rw-r--r--Test/E01options.ztst14
2 files changed, 36 insertions, 0 deletions
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index e4b6870d7..32caf5f68 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -103,6 +103,13 @@
 0:`exec' with -a option, no space
 >/bin/SPLOOSH
 
+  (
+    opts=(-a /bin/WHOOOSH)
+    exec $opts /bin/sh -c 'echo $0'
+  )
+0:`exec' with -a option from expansion
+>/bin/WHOOOSH
+
   (export FOO=bar; exec -c /bin/sh -c 'echo x${FOO}x')
 0:`exec' with -c option
 >xx
@@ -123,6 +130,21 @@
 >cat is /*/cat
 >echo is a shell builtin
 
+  args=(
+  'command -pv cat'
+  'command -pv echo'
+  'command -p -V cat'
+  'command -p -V -- echo'
+  )
+  for arg in $args; do
+    ${=arg}
+  done
+0:command -p in combination, using expansion
+*>*/cat
+>echo
+>cat is /*/cat
+>echo is a shell builtin
+
   cd() { echo Not cd at all; }
   builtin cd . && unfunction cd
 0:`builtin' precommand modifier
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index 2bd4fdb1a..dac9430cc 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -804,6 +804,20 @@
 >print is a shell builtin
 ?(eval):8: command not found: print
 
+  (
+     setopt posixbuiltins
+     opts=()
+     command $opts print foo
+     opts=(-v)
+     command $opts print
+     opts=(-V)
+     command $opts print
+  )
+0:command with options from expansion
+>foo
+>print
+>print is a shell builtin
+
   # With non-special command: original value restored
   # With special builtin: new value kept
   # With special builtin preceeded by "command": original value restored.