From: Karen Etheridge Date: Fri, 14 Mar 2014 15:45:40 +0000 (+0100) Subject: use Test::More::is for better diagnostics on failure X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a872696eb19cd068b4d295ed5bd80e126ce8996;p=p5sagit%2FModule-Metadata.git use Test::More::is for better diagnostics on failure --- diff --git a/t/metadata.t b/t/metadata.t index 9f6f478..72dee49 100644 --- a/t/metadata.t +++ b/t/metadata.t @@ -332,15 +332,16 @@ while (++$test_case and my ($expected_version, $code) = splice @modules, 0, 2 ) # Test::Builder will prematurely numify objects, so use this form my $errs; my $got = $pm_info->version; - if ( defined $expected_version ) { - ok( $got eq $expected_version, - "case $test_case: correct module version (expected '$expected_version')" ) - or $errs++; - } else { - ok( !defined($got), - "case $test_case: correct module version (expected undef)" ) - or $errs++; - } + + is( + $got, + $expected_version, + "case $test_case: correct module version (" + . (defined $expected_version? "'$expected_version'" : 'undef') + . ')' + ) + or $errs++; + is( $warnings, '', "case $test_case: no warnings from parsing" ) or $errs++; diag "Got: '$got'\nModule contents:\n$code" if $errs; }