Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: FW: Zsh 4.3.12 failure on OpenBSD
- X-seq: zsh-workers 29422
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: FW: Zsh 4.3.12 failure on OpenBSD
- Date: Wed, 1 Jun 2011 15:03:36 +0200
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=mXrophDpIgUqKmH6RrXDSxAi+D2AqqN6/GPSvFMbAIA=; b=ZOTMXmmXY9Ts0Mk+uiVVp47hHfoOYzI7RSdrNA86GRsvHNX2G80QpQS8HoM1/RToJp /OF0DfKVLutwh46lfF0nqrSOhiugKAEobHMQuxCZctKyMGr1syY6hz4l2avYilRkTKR2 TEpn2QhUo4Z3R09TYp12rpcwY/aVmohUL4KBM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Z/sVmv7G61v02Wwq/rl4B8aiG5mYQfB5Zb6V3EUwdZXd8ouTmaluRXYVLPRbP4cm/j i339aQMZ9P1q/CdbPXt0zkpedHdzbhXQZSToUc5wC3ubA4XJeQGWI723S7YbAqluS15L YtZBSqKeJLzxUGjSjlXM9trGrNe8IxRWkQjWw=
- In-reply-to: <op.vwd9d5rinba3tw@pwspc01.europe.root.pri>
- 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: <20110601094642.GA32690@coredump.raveland.priv> <FE1C78AF1864A242B1E74A21B8ED89973E5DC836@CAMEUREXM01.EUROPE.ROOT.PRI> <BANLkTimLEAyj_vLF5WMfYo0ND1EDcoqNNQ@mail.gmail.com> <op.vwd9d5rinba3tw@pwspc01.europe.root.pri>
On 1 June 2011 13:11, Peter Stephenson <pws@xxxxxxx> wrote:
> On Wed, 01 Jun 2011 11:33:22 +0100, Mikael Magnusson <mikachu@xxxxxxxxx>
> wrote:
>>
>> Okay, so in a latin1 locale, \M-a is á which is printable, so it isn't
>> converted back to \M-a by (V). I also noticed that in one of the
>> tests, the input has "^X" but not the c flag, but does use V, so the
>> test can't tell if it was converted or not, because it'll always come
>> out as ascii "^X". I guess there's not really much point in testing
>> \M-a, since I already test \C-x and it's handled by the same code. The
>> test is just for calling the function that does that properly, not
>> that that function actually works ;). I hope I can at least rely on
>> \C-x not being printable anywhere? Or is it okay to include a literal
>> ^X in the expected test output? I'm not sure how else I can test that
>> ^X is parsed properly.
>
> Ideally we want to output stuff as a stream of octets. I'm not
> sure there's an easy way of doing that with parameters alone.
> You can use $(( #foo )), looping over octets in the string.
>
> If you want to test non-ASCII characters you can use
> the multibyte test file, which ensures the locale is
> using UTF-8.
I realized that maybe the easiest way is to just test that [[
${(g:oe:):-'\C-\130'} == ${(g:c:):-'^X'} ]]; echo $? outputs 0.
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 6379c8c..050340d 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -300,23 +300,16 @@
foo='\u65\123'
print -r ${(g:o:)foo}
- foo='\u65\0123'
+ foo='\u65\0123^X\C-x'
print -r ${(g::)foo}
- foo='\u65^X'
- print -r ${(V)${(g:c:)foo}}
- foo='\u65\C-x\M-a'
- print -r ${(V)${(g:e:)foo}}
- foo='\u65\123\C-x'
- print -r ${(V)${(g:eo:)foo}}
- foo=('\u65' '\0123' '^X\M-a')
- print -r ${(V)${(g:e:)foo}}
+ foo='^X'
+ bar='\C-\130'
+ [[ ${(g:c:)foo} == ${(g:oe:)bar} ]]
+ echo $?
0:${(g)...}
>eS
->eS
->e^X
->e^X\M-a
->eS^X
->e S ^X\M-a
+>eS^X\C-x
+>0
foo='I'\''m nearly out of my mind with tedium'
bar=foo
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author