On Fri, Oct 17, 2008 at 01:47:12PM -0700, Michael G Schwern wrote:
> Martin Becker wrote:
> > On Thu, Oct 16, 2008 at 04:18:45PM -0700, Michael G Schwern wrote:
> >> http://schwern.org/src/ExtUtils-MakeMaker-6.47_02.tar.gz
> >>
> >> Cutting a new release to fix some VMS issues on the new MIN_PERL_VERSION
> >> tests.
> >>
> >>
> >> 6.47_02 Thu Oct 16 16:14:20 PDT 2008
> >> Test Fixes
> >> * MIN_PERL_VERSION test had some goofs on VMS. [thanks Craig Berry]
> >
> > Now the test has some goofs due to the changed semantics of
> > slurp ("die" replacing "return undef"). To fix that, add this patch.
>
> That change masks the reason slurp() failed. I'd rather have it die then lose
> that info.
No problem, you can take care of that without actually crashing
the test script, like so:
my $ppd_html = eval { slurp($ppd_file) };
ok( defined($ppd_html), ' .ppd file present' ) || diag($@);
...
my $meta = eval { slurp($meta_yml) };
ok( defined($meta), ' META.yml present' ) || diag($@);
Output of a failed test then will look like this:
> ok 25 - Makefile present
> ok 26 - Make ppd exiting normally
> not ok 27 - .ppd file present
> # Failed test ' .ppd file present'
> # in t/min_perl_version.t at line 177.
> # Can't open Min-PerlVers.ppd for reading: No such file or directory at
> t/lib/MakeMaker/Test/Utils.pm line 340.
> Use of uninitialized value $this in pattern match (m//) at
> t/min_perl_version.t line 179.
> not ok 28 - .ppd file content good
> # Failed test ' .ppd file content good'
> # in t/min_perl_version.t at line 179.
> # undef
> # doesn't match '(?m-xis:^\s*<PERLCORE VERSION="5,005,0,0" />)'
> ok 29 - Make metafile exiting normally
> ok 30 - META.yml present
> ok 31 - META.yml content good
> ok 32 - leaving dir
> ok 33 - teardown
> # Looks like you failed 2 tests of 33.
By the way, I left the "uninitialized value" of the next test
unguarded because I think Test::More might get better at coping
with things like that some day. As of Test::More version 0.80,
is() already has special treatment for undef whereas like()
apparently hasn't.
-Martin