summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-08-07 18:47:43 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-08-07 18:47:43 +0100
commit2eacbef91913fe967335812900d43cf2edfa54d9 (patch)
tree04c2e430d8310851464712757b8a7b3992517470 /Test
parent462dd51fb0036d702af054e4fa15290412be2af1 (diff)
downloadzsh-2eacbef91913fe967335812900d43cf2edfa54d9.tar.gz
zsh-2eacbef91913fe967335812900d43cf2edfa54d9.tar.xz
zsh-2eacbef91913fe967335812900d43cf2edfa54d9.zip
41499 (with one further tweak): POSIX_STRINGS behaviour.
Ignore a terminating delimiter when splitting as separators
despite being called separators are terminators.
Diffstat (limited to 'Test')
-rw-r--r--Test/E01options.ztst41
1 files changed, 41 insertions, 0 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index f01d83567..b394e7cf4 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -1339,3 +1339,44 @@
 ?(anon):4: `break' active at end of function scope
 ?(anon):4: `break' active at end of function scope
 ?(anon):4: `break' active at end of function scope
+
+  for opt in POSIX_STRINGS NO_POSIX_STRINGS; do
+    var="foo bar "
+    (setopt $opt; print -l X "${=var}" Y)
+    var="foo2::bar2:"
+    (setopt $opt; IFS=:; print -l X "${=var}" Y)
+    var="foo3:bar3::"
+    (setopt $opt; IFS=:; print -l X "${=var}" Y)
+  done
+0:POSIX_STRINGS effect on final delimiters
+>X
+>foo
+>bar
+>Y
+>X
+>foo2
+>
+>bar2
+>Y
+>X
+>foo3
+>bar3
+>
+>Y
+>X
+>foo
+>bar
+>
+>Y
+>X
+>foo2
+>
+>bar2
+>
+>Y
+>X
+>foo3
+>bar3
+>
+>
+>Y