From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23374 invoked by alias); 1 Jun 2011 13:03:43 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29422 Received: (qmail 21633 invoked from network); 1 Jun 2011 13:03:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: References: <20110601094642.GA32690@coredump.raveland.priv> Date: Wed, 1 Jun 2011 15:03:36 +0200 Message-ID: Subject: Re: FW: Zsh 4.3.12 failure on OpenBSD From: Mikael Magnusson To: Peter Stephenson Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 1 June 2011 13:11, Peter Stephenson wrote: > On Wed, 01 Jun 2011 11:33:22 +0100, Mikael Magnusson > wrote: >> >> Okay, so in a latin1 locale, \M-a is =C3=A1 which is printable, so it is= n'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'} =3D=3D ${(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=3D'\u65\123' print -r ${(g:o:)foo} - foo=3D'\u65\0123' + foo=3D'\u65\0123^X\C-x' print -r ${(g::)foo} - foo=3D'\u65^X' - print -r ${(V)${(g:c:)foo}} - foo=3D'\u65\C-x\M-a' - print -r ${(V)${(g:e:)foo}} - foo=3D'\u65\123\C-x' - print -r ${(V)${(g:eo:)foo}} - foo=3D('\u65' '\0123' '^X\M-a') - print -r ${(V)${(g:e:)foo}} + foo=3D'^X' + bar=3D'\C-\130' + [[ ${(g:c:)foo} =3D=3D ${(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=3D'I'\''m nearly out of my mind with tedium' bar=3Dfoo --=20 Mikael Magnusson