From f5e586f6ff90d2a3be88ac8029a3af591fa59074 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Sun, 12 May 2024 04:42:58 +0200 Subject: [PATCH] test calling slop without calling pod_lines The pod_lines builder also sets slop. And the slop builder also sets pod_lines. Add a test that calls slop first, to ensure its builder works correctly. --- t/document/file.t | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/t/document/file.t b/t/document/file.t index dc79fb5b9..5697e6881 100644 --- a/t/document/file.t +++ b/t/document/file.t @@ -110,6 +110,41 @@ END ); }; +subtest 'slop without pod_lines' => sub { + my $content = <<'END'; +package Foo; +use strict; + +=head1 NAME +X X + +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';