zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: [bug] shwordsplit not working on $@ when $# > 1
Date: Wed, 10 Aug 2016 13:56:13 +0100	[thread overview]
Message-ID: <20160810135613.6c4fa427@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <160808182124.ZM9355@torch.brasslantern.com>

> Existing tests still pass, but then they always did, this needs a
> new one.  Holding off until we think of other edge cases.

This tests the significant cases with $@.

There's already quite a lot with splitting, joining, IFS and
SH_WORD_SPLIT in that file, so I'm not sure how much more there is to
do.

Not quite sure what forced joining gets us apart from extra complexity
but too late to worry now...

pws

diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 7cb297e..6767eb2 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -1920,3 +1920,38 @@
   print $array
 0:"-" works after "[" in same expression (Dash problem)
 >foo two three
+
+  (
+  setopt shwordsplit
+  IFS=:
+  set -- whim:wham:whom
+  print -l $@
+  )
+0:Splitting of $@ on IFS: single element
+>whim
+>wham
+>whom
+
+  (
+  setopt shwordsplit
+  IFS=:
+  set -- one:two bucklemy:shoe
+  print -l $@
+  )
+0:Splitting of $@ on IFS: multiple elements
+# No forced joining in this case
+>one
+>two
+>bucklemy
+>shoe
+
+  (
+  setopt shwordsplit
+  set -- one:two bucklemy:shoe
+  print -l ${(s.:.)@}
+  )
+0:Splitting of $@ on (s): multiple elements
+# Forced joining in this case
+>one
+>two bucklemy
+>shoe


  parent reply	other threads:[~2016-08-10 13:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 11:16 Stephane Chazelas
2016-08-08 17:28 ` Bart Schaefer
2016-08-08 18:02   ` Jérémie Roquet
2016-08-08 18:27 ` Peter Stephenson
2016-08-09  1:21   ` Bart Schaefer
2016-08-09  8:40     ` Peter Stephenson
2016-08-10 17:28       ` Bart Schaefer
2016-08-11 10:05         ` Peter Stephenson
2016-08-11 17:28           ` Bart Schaefer
2016-08-12  7:50             ` Bart Schaefer
2016-08-10 12:56     ` Peter Stephenson [this message]
2016-08-11  0:39       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160810135613.6c4fa427@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).