about summary refs log tree commit diff
path: root/Test/D04parameter.ztst
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-08-11 10:08:16 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2016-08-11 10:08:16 -0700
commit4234fccef6489c9623b2226629d1bc3235d5893a (patch)
tree46bbccee5553397f88d25dc0bc96e6daa0665634 /Test/D04parameter.ztst
parentf7c3aa170b8c36b146ba7644cf3912cb1329a5d2 (diff)
downloadzsh-4234fccef6489c9623b2226629d1bc3235d5893a.tar.gz
zsh-4234fccef6489c9623b2226629d1bc3235d5893a.tar.xz
zsh-4234fccef6489c9623b2226629d1bc3235d5893a.zip
39019 (cf. PWS 39013): add test cases for more join/split combinations
Accidentally omitted from previous commit.
Diffstat (limited to 'Test/D04parameter.ztst')
-rw-r--r--Test/D04parameter.ztst55
1 files changed, 55 insertions, 0 deletions
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 7cb297e0c..35630c5ca 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -1920,3 +1920,58 @@
   print $array
 0:"-" works after "[" in same expression (Dash problem)
 >foo two three
+
+  (
+  setopt shwordsplit
+  set -- whim:wham:whom
+  IFS=:
+  print -l $@
+  )
+0:Splitting of $@ on IFS: single element
+>whim
+>wham
+>whom
+
+  (
+  setopt shwordsplit
+  set -- one:two bucklemy:shoe
+  IFS=:
+  print -l $@
+  )
+0:Splitting of $@ on IFS: multiple elements
+# No forced joining in this case
+>one
+>two
+>bucklemy
+>shoe
+
+  (
+  set -- one:two bucklemy:shoe
+  print -l ${(s.:.)@}
+  )
+0:Splitting of $@ on (s): multiple elements
+# Forced joining in this case
+>one
+>two bucklemy
+>shoe
+
+  (
+  set -- one:two bucklemy:shoe
+  print -l ${(@s.:.)@}
+  )
+0:Splitting of $@ on (@s): multiple elements
+# Forced non-joining in this case
+>one
+>two
+>bucklemy
+>shoe
+
+  (
+  set -- one:two bucklemy:shoe
+  IFS=
+  setopt shwordsplit
+  print -l ${@}
+  )
+0:Joining of $@ does not happen when IFS is empty
+>one:two
+>bucklemy:shoe