Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML CPAN distribution.

Report information
The Basics
Id: 73702
Status: resolved
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: paul [...] city-fan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.78
Fixed in: (no value)



Subject: [PATCH] YAML-0.78/t/dump-code.t tickles Perl RT#35857
I get test failures in t/dump-code.t with B::Deparse 0.69 (Perl 5.8.6) regarding code references; B::Deparse 0.71 (Perl 5.8.8) and later versions work OK. The additional use of B::Deparse just added in this test seems to be tickling Perl RT#35857, where B::Deparse doesn't handle "use warnings" correctly. Attached patch works around this issue for me. $ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t t/2-scalars..............ok t/basic-tests............ok t/bugs-emailed...........ok 3/25 skipped: various reasons t/bugs-rt................ok 13/41 skipped: various reasons t/changes................ok 1/1 skipped: Can't parse Changes file yet :( t/dump-basics............ok t/dump-blessed...........ok t/dump-code.............. # Failed test 'a code ref (n->y)' # at /builddir/build/BUILD/YAML-0.78/blib/lib/Test/YAML.pm line 65. # got: '--- !!perl/code | # { # BEGIN {${^WARNING_BITS} = "UUUUUUUUUUUU\001"} # use strict 'refs'; # 'Something at least 30 chars'; # } # ' # expected: '--- !!perl/code | # { # use warnings; # use strict 'refs'; # 'Something at least 30 chars'; # } # ' # Failed test 'an array of the same code ref (n->y)' # at /builddir/build/BUILD/YAML-0.78/blib/lib/Test/YAML.pm line 65. # got: '--- # - &1 !!perl/code | # { # BEGIN {${^WARNING_BITS} = "UUUUUUUUUUUU\001"} # use strict 'refs'; # 'Something at least 30 chars'; # } # - *1 # - *1 # ' # expected: '--- # - &1 !!perl/code | # { # use warnings; # use strict 'refs'; # 'Something at least 30 chars'; # } # - *1 # - *1 # ' # Failed test 'blessed code ref (n->y)' # at /builddir/build/BUILD/YAML-0.78/blib/lib/Test/YAML.pm line 65. # got: '--- !!perl/code:Foo::Bar | # { # BEGIN {${^WARNING_BITS} = "UUUUUUUUUUUU\001"} # use strict 'refs'; # 'Something at least 30 chars'; # } # ' # expected: '--- !!perl/code:Foo::Bar | # { # use warnings; # use strict 'refs'; # 'Something at least 30 chars'; # } # ' # Looks like you failed 3 tests of 7. dubious Test returned status 3 (wstat 768, 0x300) DIED. FAILED tests 1, 3, 7 Failed 3/7 tests, 57.14% okay t/dump-file-utf8.........ok t/dump-file..............ok t/dump-nested............ok t/dump-opts..............ok t/dump-perl-types-512....ok t/dump-perl-types-514....skipped all skipped: test only for perls v5.13.5-11-gfb85c04 or later t/dump-perl-types........ok t/dump-stringify.........ok t/dump-tests-512.........ok t/dump-tests-514.........skipped all skipped: test only for perls v5.13.5-11-gfb85c04 or later t/dump-tests.............ok t/dump-works.............ok t/errors.................ok t/export.................ok t/freeze-thaw............ok t/global-api.............ok t/inbox..................ok 3/3 skipped: fix this next release t/load-fails.............ok t/load-passes............ok t/load-slides............ok t/load-spec..............ok t/load-tests.............ok t/load-works.............ok t/marshall...............ok t/node-info..............ok t/pugs-objects...........ok t/references.............ok t/regexp.................ok t/svk....................ok t/test...................ok Failed 1/38 test scripts, 97.37% okay. 3/452 subtests failed, 99.34% okay. Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/dump-code.t 3 768 7 3 42.86% 1 3 7 2 tests and 20 subtests skipped.
Subject: YAML-0.78-perl-rt35857.patch
Versions of B::Deparse prior to 0.71 (0.69 certainly, not sure about 0.70) don't handle warnings register properly (Perl RT#35857), which needs to be worked around. --- YAML-0.78/t/dump-code.t +++ YAML-0.78/t/dump-code.t @@ -5,6 +5,9 @@ =~ 'refs') { local $/; (my $data = <DATA>) =~ s/use strict/use strict 'refs'/g; + if ($B::Deparse::VERSION < 0.71) { + $data =~ s/use warnings;/BEGIN {\${^WARNING_BITS} = "UUUUUUUUUUUU\\001"}/g; + } open DATA, '<', \$data; }
fixed in 0.80