Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML-LibYAML CPAN distribution.

Report information
The Basics
Id: 62266
Status: resolved
Priority: 0/
Queue: YAML-LibYAML

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

Bug Information
Severity: Normal
Broken in: 0.34
Fixed in: (no value)



Subject: Bleadperl fb85c04 breaks CPAN
Sorry for the spam. See http://rt.perl.org/rt3/Ticket/Display.html?id=78008 for more details.
I've just uploaded a patch that fixes the failing tests so that it works both for old and new perls. http://cpan.cpantesters.org/authors/id/A/AN/ANDK/patches/YAML-LibYAML-0.34-ANDK-01.patch.gz And here is a distroprefs file to enable the CPAN shelel to download and apply the patch on the fly: https://github.com/andk/cpanpm/blob/master/distroprefs/INGY.YAML-LibYAML.yml Enjoy,
And in the meantime I discovered there was another change causing breakage soon after the first one. So I'm providing a second patch. http://cpan.cpantesters.org/authors/id/A/AN/ANDK/patches/YAML-LibYAML-0.34-ANDK-02.patch.gz I've also adjusted the distroprefs file to reflect both patches Enjoy,
Another ticket for bleadperl is intersecting with YAML::XS: http://rt.perl.org/rt3/Ticket/Display.html?id=80212 At the moment I don't know how this should be fixed.
If demerphq is right, and since nobody contradicts in the ticket I've linked to he probably is, then the is() tests in regexp.t need to be replaced by tests that verify that the dumped and re-loaded regexps work. This makes sense to me and I'm tempted to withdraw my previous patches and replace them with something that makes more sense in the light of the recent development. What does Ingy, what do others think/prefer?
I ended up with this patch for our build system. It just disables those tests that rely on exact match, only leaving those tests that verify that dumped and reloaded regexps match as expected.
Subject: YAML-LibYAML-03-regexp-t.patch
From d4caa31ca688ab775f0359f7ede20722b7395f23 Mon Sep 17 00:00:00 2001 From: Gisle Aas <gisle@activestate.com> Date: Tue, 29 Mar 2011 10:45:10 -0800 Subject: [PATCH] Skip strict match on stringified regexps for perl-5.14 Only leave tests that verify that the regexps can be loaded back and still match the expected strings. Ref https://rt.cpan.org/Ticket/Display.html?id=62266 --- t/regexp.t | 31 ++++++++++++++++++++++++------- 1 files changed, 24 insertions(+), 7 deletions(-) diff --git a/t/regexp.t b/t/regexp.t index e6e5477..c2d9db2 100644 --- a/t/regexp.t +++ b/t/regexp.t @@ -4,21 +4,27 @@ use Devel::Peek(); my $rx1 = qr/5050/; my $yaml1 = Dump $rx1; -is $yaml1, <<'...', 'Regular regexp dumps'; ---- !!perl/regexp (?-xism:5050) -... - my $rx2 = qr/99999/; bless $rx2, 'Classy'; my $yaml2 = Dump $rx2; +my $rx3 = qr/^edcba/mi; +my $yaml3 = Dump $rx3; + +sub perl514 { + # https://rt.cpan.org/Ticket/Display.html?id=62266 + skip "perl-5.14 regexp stringification is different", shift || 1 if $] > 5.013; +} + +SKIP: { perl514 5; +is $yaml1, <<'...', 'Regular regexp dumps'; +--- !!perl/regexp (?-xism:5050) +... + is $yaml2, <<'...', 'Blessed regular regexp dumps'; --- !!perl/regexp:Classy (?-xism:99999) ... -my $rx3 = qr/^edcba/mi; -my $yaml3 = Dump $rx3; - is $yaml3, <<'...', 'Regexp with flags dumps'; --- !!perl/regexp (?mi-xs:^edcba) ... @@ -37,27 +43,38 @@ my $yaml5 = Dump $rx5; is $yaml5, <<"...", 'Unicode regexp dumps'; --- !!perl/regexp (?-xism:\xC4\x80) ... +} my $rx1_ = Load($yaml1); is ref($rx1_), 'Regexp', 'Can Load a regular regexp'; +SKIP: { perl514; is $rx1_, '(?-xism:5050)', 'Loaded regexp value is correct'; +} like "404050506060", $rx1_, 'Loaded regexp works'; my $rx2_ = Load($yaml2); is ref($rx2_), 'Classy', 'Can Load a blessed regexp'; +SKIP: { perl514; is $rx2_, '(?-xism:99999)', 'Loaded blessed regexp value is correct'; +} ok "999999999" =~ $rx2_, 'Loaded blessed regexp works'; my $rx3_ = Load($yaml3); is ref($rx3_), 'Regexp', 'Can Load a regexp with flags'; +SKIP: { perl514; is $rx3_, '(?mi-xs:^edcba)', 'Loaded regexp with flags value is correct'; +} like "foo\neDcBA\n", $rx3_, 'Loaded regexp with flags works'; my $rx4_ = Load("--- !!perl/regexp (?msix:123)\n"); is ref($rx4_), 'Regexp', 'Can Load a regexp with all flags'; +SKIP: { perl514; is $rx4_, '(?msix:123)', 'Loaded regexp with all flags value is correct'; +} my $rx5_ = Load("--- !!perl/regexp (?msix:\xC4\x80)\n"); is ref($rx5_), 'Regexp', 'Can Load a unicode regexp'; +SKIP: { perl514; is $rx5_, "(?msix:\x{100})", 'Loaded unicode regexp value is correct'; +} -- 1.7.0.5
I applied ANDK's last patch for now. Going to resolve this. Need to refactor all tests anyway. Tested against 5.10.1 and 5.14.0.