Skip to content

Commit

Permalink
report line numbers for TODOs in token_unknown.t to help find passing…
Browse files Browse the repository at this point in the history
… ones
  • Loading branch information
wchristian committed May 11, 2017
1 parent 3f871bd commit 37c2bc9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion t/ppi_token_unknown.t
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,16 @@ sub one_line_explain {
return join "", @explain;
}

sub main_level_line {
return "" if not $TODO;
my @outer_final;
my $level = 0;
while ( my @outer = caller($level++) ) {
@outer_final = @outer;
}
return "l $outer_final[2] - ";
}

sub test_statement {
local $Test::Builder::Level = $Test::Builder::Level+1;
my ( $code, $expected, $msg ) = @_;
Expand All @@ -555,7 +565,7 @@ sub test_statement {
if ( $expected->[0] !~ /^PPI::Statement/ ) {
$expected = [ 'PPI::Statement', $code, @$expected ];
}
my $ok = is_deeply( $tokens, $expected, $msg );
my $ok = is_deeply( $tokens, $expected, main_level_line.$msg );
if ( !$ok ) {
diag ">>> $code -- $msg\n";
diag one_line_explain $tokens;
Expand Down

0 comments on commit 37c2bc9

Please sign in to comment.