Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: revert 39611 and add tests and comments
- X-seq: zsh-workers 40139
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: revert 39611 and add tests and comments
- Date: Fri, 9 Dec 2016 10:57:11 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=JzKpX+NsT5Nze6R q6Bz8v/GunQI=; b=gia60lklIYyx/Cp8lltmFuT9vi8EAqICaoDvqVBxlA+FvK6 ZIJXZm0A8odqkxUK7yjfflCRpQcKhM1P+h9CwvpUjV/SnUq5wpVCAlioZawPNN4r JrEDb1Lye5/y0zKf2VccE/62VifE9O2tnyd7ToxyzifiAZNyFhc4Io0NhRps=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=JzKpX+NsT5Nze6 Rq6Bz8v/GunQI=; b=FxAsrRHMeUWboLw2d+J94fiyElXfr3LyxZbZyebnhGwjXI Pagu/tG6xgo7UbjfZPk0SEElGzc/pvqwCTnKdINbNuqgUhlpPVjOZSwAgfzejBy1 n6jBB2QTwZwAB7fWONfURZ1TXJtVi/+PNkFw+riVqJl52t0WftvGunkCayBRk=
- In-reply-to: <161208170249.ZM5203@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <92933.1481227490@hydra.kiddle.eu> <161208170249.ZM5203@torch.brasslantern.com>
Bart Schaefer wrote on Thu, Dec 08, 2016 at 17:02:49 -0800:
> On Dec 8, 9:04pm, Oliver Kiddle wrote:
> }
> } In an attempt to avoid a repeat when I come to do that, this adds
> } fairly comprehensive tests of _arguments. No tests for the little
> } used -w because it is either broken or I was too confused. Or -n
> } for somewhat similar reasons. A few tests are commented where I
> } think the behaviour is not right.
>
> I've been adding such comments as "F:" lines in the redirection part
> of the test, so that they're printed if the test fails. Comment in
> B01cd says "useful for explaining certain frequent errors, for example
> ones which may arise from the environment rather than from the shell"
> but this seems ideal for explaining *expected* failures such as might
> happen if a questionable behavior is deliberately changed.
Agreed, done, also added a backslash per another comment. I didn't
check why four backslashes were required.
diff --git a/Test/Y03arguments.ztst b/Test/Y03arguments.ztst
index b5a5a4b..6f0cac0 100644
--- a/Test/Y03arguments.ztst
+++ b/Test/Y03arguments.ztst
@@ -40,14 +40,13 @@
>NO:{a}
>NO:{b}
-# it ought to be possible to include the quoted backslash here
- tst_arguments ':desc2:((a\:a\ value b\:other\\value))'
+ tst_arguments ':desc2:((a\:a\ value b\:other\\\\value))'
comptest $'tst \t'
0:a and b with descriptions
>line: {tst }{}
>DESCRIPTION:{desc2}
>NO:{a -- a value}
->NO:{b -- othervalue}
+>NO:{b -- other\value}
tst_arguments ':desc1:(arg1)' ':desc2:(arg2)' ':desc3:(arg3)'
comptest $'tst \t\t\t\C-w\C-w\C-w\C-d'
@@ -430,7 +429,6 @@
>line: {tst -h -}{}
>MESSAGE:{no arguments}
-# this would ideally not offer -b as it is already on the command-line
tst_arguments -a '(-a)-b'
comptest $'tst - -b\C-b\C-b\C-b\t'
0:exclusion only applies to later words
@@ -438,8 +436,8 @@
>DESCRIPTION:{option}
>NO:{-a}
>NO:{-b}
+F:shouldn't offer -b as it is already on the command-line
-# ideally, would handle exclusion within the current word
tst_arguments -s : '(-d)-a' -b -c -d
comptest $'tst -ab\t -\t\eb\eb \C-b-\t'
0:exclusion with clumped options, in, after and before
@@ -454,17 +452,18 @@
>NO:{-b}
>NO:{-c}
>NO:{-d}
+F:the first tab press shouldn't offer -d since -a is on the command line
tst_arguments '-a:arg' -b '(-b)-c'
comptest $'tst -a -c -\t'
0:exclusion with option argument that looks like an option
>line: {tst -a -c -}{}
>MESSAGE:{no arguments}
-# seems we don't handle this case, ideal result would be as follows
-#>line: {tst -a -c -}{}
-#>DESCRIPTION:{option}
-#>NO:{-b}
-#>NO:{-c}
+F:The current behaviour is wrong; the correct expected output is:
+F:>line: {tst -a -c -}{}
+F:>DESCRIPTION:{option}
+F:>NO:{-b}
+F:>NO:{-c}
tst_arguments --abc --aah :arg:
comptesteval 'setopt bashautolist automenu'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author