Skip to content

Commit 13b6cb4

Browse files
erichermanbook
andcommitted
test merge-deltas.pl dies on unexpected =head1
Co-authored-by: Philippe Bruhat (BooK) <[email protected]>
1 parent aa8aa51 commit 13b6cb4

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

t/porting/merge-deltas.t

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,36 @@ do("../Porting/merge-deltas.pl") or die $@ || $!;
2525
is( as_pod( tree_for($pod) ), $pod, 'as_pod( tree_pod ) round-trips' );
2626
}
2727

28-
# loop_head1
28+
# loop_head1 (with unexpected head1)
29+
{
30+
my $template = tree_for( <<~ 'POD' );
31+
=head1 Unexpected
32+
33+
=cut
34+
POD
35+
36+
# loop_head1 dies on unexpected =head1
37+
# the callback is only run on the unskipped sections
38+
ok(
39+
!eval {
40+
loop_head1(
41+
[],
42+
$template,
43+
'bogus_delta.pod',
44+
sub {}
45+
);
46+
1;
47+
},
48+
'loop_head1 dies on unexpected =head1'
49+
);
50+
is(
51+
$@,
52+
"Unexpected section '=head1 Unexpected' in bogus_delta.pod\n",
53+
'.. expected error message for loop_head1'
54+
);
55+
}
56+
57+
# loop_head1 test contents of template have not changed
2958
{
3059
my $template_file = "../Porting/perldelta_template.pod";
3160
my $template = tree_for( slurp($template_file) );

0 commit comments

Comments
 (0)