Skip Menu |

This queue is for tickets about the Regexp-Assemble CPAN distribution.

Report information
The Basics
Id: 17507
Status: resolved
Priority: 0/
Queue: Regexp-Assemble

People
Owner: dland [...] cpan.org
Requestors: BARBIE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.23
Fixed in: (no value)



Subject: Windows & the substitute key
There appears to be a problem with the substitute key on Windows, for at least Perl 5.6.1, which cause this test script to terminate immediately on encountering the character. The character is '0x1a'. The attached patch, corrects 04_match.t, to ignore testing of the substitute character on Windows. I haven't tested this on 5.8, but I suspect by the CPAN testers results, that it works fine.
Subject: substitute.patch
--- Regexp-Assemble-0.23/t/04_match.t Sat Nov 26 17:19:24 2005 +++ Regexp-Assemble-0.23-barbie/t/04_match.t Mon Jan 30 12:04:58 2006 @@ -21,6 +21,12 @@ my $fixed = 'The scalar remains the same'; $_ = $fixed; +# There appears to be a problem with the substitute key on Windows, for +# at least Perl 5.6.1, which cause this test script to terminate +# immediately on encountering the character. +my $win32_56x = ($^O eq 'MSWin32' && $^[ < 5.008) ? 1 : 0; +my $subchr = 0x1a; + sub match { my $re = Regexp::Assemble->new; my $rela = Regexp::Assemble->new->lookahead(1); @@ -80,24 +86,31 @@ for my $outer ( 0 .. 15 ) { my $re = Regexp::Assemble->new; for my $inner ( 0 .. 15 ) { - $re->add( quotemeta( chr( $outer*16 + $inner ))); + next if($win32_56x && $subchr == ($outer*16 + $inner)); # sub key + $re->add( chr( $outer*16 + $inner )); } for my $inner ( 0 .. 15 ) { - my $ch = chr($outer*16 + $inner); - ok( $ch =~ /^$re$/, - "run $ch ($outer:$inner) $re" - ); + if($win32_56x && $subchr == ($outer*16 + $inner)) { + ok(1); + } else { + my $ch = chr($outer*16 + $inner); + ok( $ch =~ /^$re$/, + "run $ch ($outer:$inner) $re" + ); + } } } } for( 0 .. 255 ) { + if($win32_56x && $subchr == $_) { ok(1);next; } my $ch = chr($_); my $qm = Regexp::Assemble->new->add(quotemeta($ch)); ok( $ch =~ /^$qm$/, "$_: quotemeta($ch)" ); } for( 0 .. 127 ) { + if($win32_56x && $subchr == $_) { ok(1);ok(1);next; } my $lo = chr($_); my $hi = chr($_+128); my $qm = Regexp::Assemble->new->add(
On Mon Feb 06 12:23:10 2006, BARBIE wrote: Show quoted text
> There appears to be a problem with the substitute key on Windows, for at > least Perl 5.6.1, which cause this test script to terminate immediately > on encountering the character. The character is '0x1a'. > > The attached patch, corrects 04_match.t, to ignore testing of the > substitute character on Windows. I haven't tested this on 5.8, but I > suspect by the CPAN testers results, that it works fine.
Thanks for this, Barbie. For some reason my RT filter didn't show it up, and/or I ignored the e-mail alert. I'll have a look at this and organise a fix. Oddly enough I do a check on Win32 before uploading a new version. I'll have to see what perl version I'm using. Thanks again! David -- The Lusty Decadent Delights of Imperial Pompeii
Subject: A fux for Windows & the substitute key
On Mon Feb 06 12:23:10 2006, BARBIE wrote: Show quoted text
> There appears to be a problem with the substitute key on Windows, for at > least Perl 5.6.1, which cause this test script to terminate immediately > on encountering the character. The character is '0x1a'. > > The attached patch, corrects 04_match.t, to ignore testing of the > substitute character on Windows. I haven't tested this on 5.8, but I > suspect by the CPAN testers results, that it works fine.
Hi barbie, Try as I might, I cannot replicate this failure you encounter. Are you using a Unixish shell? Can you give me a perl -V output? Anything else out of the ordinary? I have included your patch in t/04_match.t. I had trouble with $^[ and used $] instead. I more not sure off the the top of my head as to what the difference is. Can you take the following tarball for a spin and see if you have more luck with it? http://www.landgren.net/Regexp-Assemble-0.26.tar.gz Thanks, David -- The Lusty Decadent Delights of Imperial Pompeii
On Mon Feb 06 12:23:10 2006, BARBIE wrote: Show quoted text
> There appears to be a problem with the substitute key on Windows, for at > least Perl 5.6.1, which cause this test script to terminate immediately > on encountering the character. The character is '0x1a'. > > The attached patch, corrects 04_match.t, to ignore testing of the > substitute character on Windows. I haven't tested this on 5.8, but I > suspect by the CPAN testers results, that it works fine.
I believe this is fixed in 0.27. If you could take it for a spin and confirm, I'll shout you a beer in Birmingham! Thanks. David -- The Lusty Decadent Delights of Imperial Pompeii
On Mon Feb 06 12:23:10 2006, BARBIE wrote: Show quoted text
> There appears to be a problem with the substitute key on Windows, for at > least Perl 5.6.1, which cause this test script to terminate immediately > on encountering the character. The character is '0x1a'. > > The attached patch, corrects 04_match.t, to ignore testing of the > substitute character on Windows. I haven't tested this on 5.8, but I > suspect by the CPAN testers results, that it works fine.
Barbie, are you still seeing this problem? I'd like to close the ticket, for I believe it has been resolved (but since I can't reproduce it, I need your confirmation). Thanks, David
From: BARBIE [...] cpan.org
Hi David, Sorry it's taken so long to get back into things. Show quoted text
> are you still seeing this problem? I'd like to close the ticket, for I > believe it has been resolved (but since I can't reproduce it, I need > your confirmation).
I've just tested it and it works a treat. Thanks :) Barbie
Groovy!