zsh-workers
 help / color / mirror / code / Atom feed
* FW: Zsh 4.3.12 failure on OpenBSD
       [not found] <20110601094642.GA32690@coredump.raveland.priv>
@ 2011-06-01 10:04 ` Peter Stephenson
  2011-06-01 10:33   ` Mikael Magnusson
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2011-06-01 10:04 UTC (permalink / raw)
  To: zsh-workers


________________________________________
From: Pierre-Emmanuel André [pea@raveland.org]
Sent: 01 June 2011 10:46
To: Peter Stephenson
Subject: Zsh 4.3.12 failure on OpenBSD

Hi Peter,

Sorry for the late feedback.
I tried zsh-4.3.11-dev-3 on OpenBSD and there was no pbs.
I didn't try dev-4 (no time).
I wanted to update the OpenBSD port but i have a pb with
regress tests on OpenBSD @amd64.

./D04parameter.ztst: starting.
*** /usr/ports/pobj/zsh-4.3.12/zsh-4.3.12/tmp.ztst.out.24079    Wed Jun  1 11:40:42 2011
--- /usr/ports/pobj/zsh-4.3.12/zsh-4.3.12/tmp.ztst.tout.24079   Wed Jun  1 11:40:42 2011
***************
*** 1,6 ****
  eS
  eS
  e^X
! e^X\M-a
  eS^X
! e S ^X\M-a
--- 1,6 ----
  eS
  eS
  e^X
! e^X�
  eS^X
! e S ^X�
Test ./D04parameter.ztst failed: output differs from expected as shown above for:
  foo='\u65\123'
  print -r ${(g:o:)foo}
  foo='\u65\0123'
  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}}
Was testing: ${(g)...}
./D04parameter.ztst: test failed.


As I said, dev-3 doesn't have this pb (all regress tests are fine).
Any ideas ?

Regards,

--
Pierre-Emmanuel André <pea at raveland.org>
GPG key: 0x7AE329DC


 To report this email as spam click https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg== .


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FW: Zsh 4.3.12 failure on OpenBSD
  2011-06-01 10:04 ` FW: Zsh 4.3.12 failure on OpenBSD Peter Stephenson
@ 2011-06-01 10:33   ` Mikael Magnusson
  2011-06-01 11:11     ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Magnusson @ 2011-06-01 10:33 UTC (permalink / raw)
  To: zsh-workers

On 1 June 2011 12:04, Peter Stephenson <Peter.Stephenson@csr.com> wrote:
>
> ________________________________________
> From: Pierre-Emmanuel André [pea@raveland.org]
> Sent: 01 June 2011 10:46
> To: Peter Stephenson
> Subject: Zsh 4.3.12 failure on OpenBSD
>
> Hi Peter,
>
> Sorry for the late feedback.
> I tried zsh-4.3.11-dev-3 on OpenBSD and there was no pbs.
> I didn't try dev-4 (no time).
> I wanted to update the OpenBSD port but i have a pb with
> regress tests on OpenBSD @amd64.
>
> ./D04parameter.ztst: starting.
> *** /usr/ports/pobj/zsh-4.3.12/zsh-4.3.12/tmp.ztst.out.24079    Wed Jun  1 11:40:42 2011
> --- /usr/ports/pobj/zsh-4.3.12/zsh-4.3.12/tmp.ztst.tout.24079   Wed Jun  1 11:40:42 2011
> ***************
> *** 1,6 ****
>  eS
>  eS
>  e^X
> ! e^X\M-a
>  eS^X
> ! e S ^X\M-a
> --- 1,6 ----
>  eS
>  eS
>  e^X
> ! e^X�
>  eS^X
> ! e S ^X�
> Test ./D04parameter.ztst failed: output differs from expected as shown above for:
>  foo='\u65\123'
>  print -r ${(g:o:)foo}
>  foo='\u65\0123'
>  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}}
> Was testing: ${(g)...}
> ./D04parameter.ztst: test failed.

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.

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FW: Zsh 4.3.12 failure on OpenBSD
  2011-06-01 10:33   ` Mikael Magnusson
@ 2011-06-01 11:11     ` Peter Stephenson
  2011-06-01 13:03       ` Mikael Magnusson
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2011-06-01 11:11 UTC (permalink / raw)
  To: zsh-workers

On Wed, 01 Jun 2011 11:33:22 +0100, Mikael Magnusson <mikachu@gmail.com>  
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.

pws



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FW: Zsh 4.3.12 failure on OpenBSD
  2011-06-01 11:11     ` Peter Stephenson
@ 2011-06-01 13:03       ` Mikael Magnusson
  2011-06-01 15:20         ` Pierre-Emmanuel André
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Magnusson @ 2011-06-01 13:03 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

On 1 June 2011 13:11, Peter Stephenson <pws@csr.com> wrote:
> On Wed, 01 Jun 2011 11:33:22 +0100, Mikael Magnusson <mikachu@gmail.com>
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FW: Zsh 4.3.12 failure on OpenBSD
  2011-06-01 13:03       ` Mikael Magnusson
@ 2011-06-01 15:20         ` Pierre-Emmanuel André
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre-Emmanuel André @ 2011-06-01 15:20 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: Peter Stephenson, zsh-workers

On Wed, Jun 01, 2011 at 03:03:36PM +0200, Mikael Magnusson wrote:
> On 1 June 2011 13:11, Peter Stephenson <pws@csr.com> wrote:
> > On Wed, 01 Jun 2011 11:33:22 +0100, Mikael Magnusson <mikachu@gmail.com>
> > 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
> 
> 

Your diff fixes my issue. All tests are now ok.
Regards,

-- 
Pierre-Emmanuel André <pea at raveland.org>
GPG key: 0x7AE329DC


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-01 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20110601094642.GA32690@coredump.raveland.priv>
2011-06-01 10:04 ` FW: Zsh 4.3.12 failure on OpenBSD Peter Stephenson
2011-06-01 10:33   ` Mikael Magnusson
2011-06-01 11:11     ` Peter Stephenson
2011-06-01 13:03       ` Mikael Magnusson
2011-06-01 15:20         ` Pierre-Emmanuel André

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).