Subject: | ExtUtils::MakeMaker fails "make test" with YAML::Tiny version 1.04 |
While updating from ExtUtils::MakeMaker 6.30 to ExtUtils::MakeMaker
6.56, "make test" failed on t/metafile_file.t, with the following error
report:
1..16
ok 1 - dump for flat hashes works ok
ok 2 - dumping strings and undefs is ok
ok 3 - dump for nested hashes works ok
ok 4 - nested hashes sort ascii-betically
ok 5 - dump for hashes (with more nesting) works ok
ok 6 - array of strings are handled ok
ok 7 - empty hashes and arrays
ok 8 - dump for something like META.yml works
ok 9 - META.yml with extra 'recommends' works
ok 10 - META.yml with extra 'no_index' works
ok 11 - META.yml can be read by YAML.pm
not ok 12 - YAML::Tiny saw one document in META.yml
# Failed test 'YAML::Tiny saw one document in META.yml'
# at t/metafile_file.t line 274.
# got: '2'
# expected: '1'
not ok 13 - META.yml can be read by YAML::Tiny
# Failed test 'META.yml can be read by YAML::Tiny'
# at t/metafile_file.t line 275.
# Structures begin differing at:
# $got = '#YAML:1.0'
# $expected = HASH(0x98403a8)
ok 14 - no quoting is done
ok 15 - we don't like but hash/array refs
ok 16 - we also don't like but array of strings
# Looks like you failed 2 tests of 16.
Looking at the file, line 274 is checking the results of the call to
YAML::Tiny::Load on line 273. The interface to this function changed
between YAML::Tiny versions 1.04 and 1.41; in 1.04, it returns a
flattened hash, and in 1.41, it just returns the values.
Suggested fix:
Change line 271 from this:
unless eval { require YAML::Tiny; };
to this:
unless eval { require YAML::Tiny; }
and $YAML::Tiny::Version >= 1.41;