Skip Menu |

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

Report information
The Basics
Id: 13932
Status: resolved
Priority: 0/
Queue: Regexp-Optimizer

People
Owner: Nobody in particular
Requestors: adamk [...] cpan.org
Cc:
AdminCc:

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



Subject: Tests fail
fission:~/.cpan/build/Regexp-Optimizer-0.15# perl -Ilib t/02-list.t 1..24 ok 1 - l->l(1 2) eq (?-xism:[12]) ok 2 - o->o(1|2) eq (?-xism:[12]) ok 3 - l->l(1 12) eq (?-xism:12?) ok 4 - o->o(1|12) eq (?-xism:12?) ok 5 - l->l(aa ab) eq (?-xism:a[ab]) ok 6 - o->o(aa|ab) eq (?-xism:a[ab]) ok 7 - l->l(1 12 123) eq (?-xism:1(?:23?)?) ok 8 - o->o(1|12|123) eq (?-xism:1(?:23?)?) ok 9 - l->l(not optimized) eq (?-xism:(?:not|optimized)) ok 10 - o->o(not|optimized) eq (?-xism:(?:not|optimized)) ok 11 - l->l(foobar fooxar) eq (?-xism:foo[bx]ar) ok 12 - o->o(foobar|fooxar) eq (?-xism:foo[bx]ar) ok 13 - l->l(\cZ|\cA) eq (?-xism:\\c[ZA]) ok 14 - o->o(\cZ|\cA) ne (?-xism:\\c[ZA]) ok 15 - o->o(\cZ|\cA) eq (?-xism:[\cZ\cA]) ok 16 - l->l(\x20|\x3F) eq (?-xism:\\x(?:20|3F)) ok 17 - o->o(\x20|\x3F) ne (?-xism:\\x(?:20|3F)) ok 18 - o->o(\x20|\x3F) eq (?-xism:[\x20\x3F]) ok 19 - l->l(\012|\015) eq (?-xism:\\01[25]) ok 20 - o->o(\012|\015) ne (?-xism:\\01[25]) ok 21 - o->o(\012|\015) eq (?-xism:[\012\015]) ok 22 - l->l(): all words in t/02-list.t Substitution loop at lib/Regexp/List.pm line 317, <F> line 168. # Looks like you planned 24 tests but only ran 22. # Looks like your test died just after 22. Looks like something moderately fundamental... main::(t/02-list.t:75): my $re_o = $o->optimize($re_trivial); DB<5> n Substitution loop at lib/Regexp/List.pm line 317, <F> line 168. I don't know if it's just me, but the "trivial" word list seems to have a lot of duplicates, not sure if that's meant to happen 300 'o' 301 'all' 302 'words' 303 'in' 304 'is' 305 're' 306 'l' 307 're' 308 'o' 309 'l' 310 'l' 311 'and' 312 'o' 313 'o' 314 'agrees'
Is this Module still supported? It doesn't build and hasn't been worked on for a long time.
At present, on Perl 5.12.1, there is only one spot that appears to fail and it does appear to be the test. The attached patch appears to fix it.
Subject: rt13932.patch
--- t/03-utf8.t.orig 2010-07-02 08:28:08.000000000 -0500 +++ t/03-utf8.t 2010-07-02 08:28:15.000000000 -0500 @@ -18,7 +18,7 @@ } use strict; use warnings; -use Test::More tests => 18; +use Test::More tests => 15; use Regexp::Optimizer; my $l = Regexp::List->new(lookahead => 0); my $o = Regexp::Optimizer->new; @@ -37,7 +37,7 @@ $qq_utf8 => qr/$qr_utf8_l/, q/\x20|\x{3000}/ => qr/\\x(?:20|\{3000\})/, q/\p{Kanji}|\P{Hiragana}/ => qr/\\(?:p\{Kanji|P\{Hiragana)\}/, - q/\N{DIGIT ONE}|\N{DIGIT TWO}/ => qr/\\N\{DIGIT\ (?:ONE|TWO)\}/, +# q/\N{DIGIT ONE}|\N{DIGIT TWO}/ => qr/\\N\{DIGIT\ (?:ONE|TWO)\}/, q/\C|\X/ => qr/\\[CX]/, );
As of version 0.20 of Regexp::Optimizer now uses Regexp::Assemble instead of Regexp::List to optimize alteration. Dan