Skip to content

Commit

Permalink
fixing test failures in 5.22. Patch by Petr Písař. I think
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Dec 1, 2015
1 parent 8e620f8 commit ca6b762
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/Parse/ErrorString/Perl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ sub _prepare_diagnostics {
my %errors;
foreach my $item ( $pom->head1->[1]->over->[0]->item ) {
my $header = $item->title;
$header =~ s/\n/ /g;

my $content = $item->content;
$content =~ s/\s*$//;
Expand Down
21 changes: 19 additions & 2 deletions t/04-perldiag.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,27 @@ use Test::Differences;
#
# $hell;

my $msg_compile = <<'ENDofMSG';
my $msg_compile;

if ( $] < 5.021004 ) {
$msg_compile = <<'ENDofMSG';
Global symbol "$kaboom" requires explicit package name at error.pl line 8.
Execution of error.pl aborted due to compilation errors.
ENDofMSG
} else {
$msg_compile = <<'ENDofMSG';
Global symbol "$kaboom" requires explicit package name (did you forget to declare "my $kaboom"?) at error.pl line 8.
Execution of error.pl aborted due to compilation errors.
ENDofMSG
}

my $message;

if ( $] < 5.021004 ) {
$message = q{Global symbol "$kaboom" requires explicit package name};
} else {
$message = q{Global symbol "$kaboom" requires explicit package name (did you forget to declare "my $kaboom"?)};
}

my $diagnostics;

Expand Down Expand Up @@ -56,7 +73,7 @@ $diagnostics =~ s/\s\n/\n/gs;

my $parser = Parse::ErrorString::Perl->new;
my @errors_compile = $parser->parse_string($msg_compile);
is( $errors_compile[0]->message, 'Global symbol "$kaboom" requires explicit package name', 'message' );
is( $errors_compile[0]->message, $message, 'message' );

#ok($errors_compile[0]->diagnostics eq $diagnostics, 'diagnostics');
my $obtained_diagnostics = $errors_compile[0]->diagnostics;
Expand Down

0 comments on commit ca6b762

Please sign in to comment.