From 2eacbef91913fe967335812900d43cf2edfa54d9 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 7 Aug 2017 18:47:43 +0100 Subject: 41499 (with one further tweak): POSIX_STRINGS behaviour. Ignore a terminating delimiter when splitting as separators despite being called separators are terminators. --- Test/E01options.ztst | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'Test') 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 -- cgit 1.4.1