Perl-Critic / PPI

54 stars 44 forks source link

failed to parse documents which have indent heredoc #203

Closed skaji closed 1 year ago

skaji commented 7 years ago

I expected this test passed, but in fact, it failed.

use 5.26.0;
use PPI::Document;
use Test::More;

my $content = q(
my $x = <<~EOF;
} /* */
EOF

=head1 NAME

name - abstract

=cut
);

my $doc = PPI::Document->new(\$content);
my $pod = $doc->find('PPI::Token::Pod');

ok $pod, "find pod element";

done_testing;
❯ prove test.t
test.t .. 1/?
#   Failed test 'find pod element'
#   at test.t line 20.
# Looks like you failed 1 test of 1.
test.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests

Test Summary Report
-------------------
test.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=1, Tests=1,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.08 cusr  0.01 csys =  0.11 CPU)
Result: FAIL
zmughal commented 1 year ago

This can be closed via #209.

oalders commented 1 year ago

Thanks for the reminder @zmughal!