about summary refs log tree commit diff
path: root/Test/D04parameter.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-02-12 20:27:48 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-02-12 20:27:48 +0000
commit53f893d0626f2d683f6da229301c5dbb75d8dbe8 (patch)
tree8a0cf05abf9a734bc4d51f97a3082cdbbbdd5ea1 /Test/D04parameter.ztst
parentcbbed5ed847372b0ba028620138e509a5401a4ff (diff)
downloadzsh-53f893d0626f2d683f6da229301c5dbb75d8dbe8.tar.gz
zsh-53f893d0626f2d683f6da229301c5dbb75d8dbe8.tar.xz
zsh-53f893d0626f2d683f6da229301c5dbb75d8dbe8.zip
30181, plus rename of PF_* flags to PREFORK_*:
Pass sh-wordsplitting instructions to paramsubst() using flags,
avoiding side effects of explicitly setting and unsetting the
SHWORDSPLIT option.
Diffstat (limited to 'Test/D04parameter.ztst')
-rw-r--r--Test/D04parameter.ztst14
1 files changed, 14 insertions, 0 deletions
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 71c79687f..69606e453 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -255,6 +255,20 @@
 >two
 >words
 
+  (setopt shwordsplit # ensure this doesn't get set in main shell...
+  test_splitting ()
+  {
+    array="one two three"
+    for e in $array; do
+      echo "'$e'"
+    done
+  }
+  test_split_var=
+  : ${test_split_var:=$(test_splitting)}
+  echo "_${test_split_var}_")
+0:SH_WORD_SPLIT inside $(...) inside ${...}
+>_'one' 'two' 'three'_
+
   print -l "${(f)$(print first line\\nsecond line\\nthird line)}"
 0:${(f)$(...)}
 >first line