Skip to content

Commit

Permalink
Merge pull request #1216 from metacpan/haarg/check-slop
Browse files Browse the repository at this point in the history
test calling slop without calling pod_lines
  • Loading branch information
haarg authored May 12, 2024
2 parents 6c65f2f + f5e586f commit bf3ba16
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions t/document/file.t
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,41 @@ END
);
};

subtest 'slop without pod_lines' => sub {
my $content = <<'END';
package Foo;
use strict;
=head1 NAME
X<Foo> X<Bar>
MyModule - mymodule1 abstract
not this
=pod
bla
=cut
more perl code
=head1 SYNOPSIS
more pod
more
even more
END

my $file = new_file_doc( content => \$content );

is( $file->slop, 11, 'slop is correct without first calling pod_lines' );
is_deeply( $file->pod_lines, [ [ 3, 12 ], [ 18, 6 ] ] );
};

subtest 'just pod' => sub {
my $content = <<'END';
Expand Down

0 comments on commit bf3ba16

Please sign in to comment.