use strict;
use warnings;
use File::Spec;
use Test::More;
if ($ENV{NO_PERL_CRITIC}) {
plan( skip_all => '$NO_PERL_CRITIC set, skipping');
}
eval { require Test::Perl::Critic; };
if ( $@ ) {
my $msg = 'Test::Perl::Critic required to criticise code';
plan( skip_all => $msg );
}
my $rcfile = File::Spec->catfile( 't', 'perlcriticrc' );
Test::Perl::Critic->import( -profile => $rcfile );
all_critic_ok();
Test::Perl::Critic does $TEST->use_numbers(0). Later, in the JUnit renderer, this line fires:
my $test_num = sprintf( "%04d", $event->{'assert_count'} || $f->{'assert'}->{'number'} || die Dumper $event);
There are no numbers, and (I think this matters), the plan runs before there's any count of asserts. We hit the die, which just blats a dump to the screen and exits.
At least the Dumper should include "can't handle assert with no number", but better, it should cope somehow.
Here is a test from andk/PAUSE
Test::Perl::Critic does
$TEST->use_numbers(0)
. Later, in the JUnit renderer, this line fires:There are no numbers, and (I think this matters), the plan runs before there's any count of asserts. We hit the die, which just blats a dump to the screen and exits.
At least the Dumper should include "can't handle assert with no number", but better, it should cope somehow.