Skip to content

Commit 44a0d24

Browse files
bookericherman
authored andcommitted
use t/test.pl for testing
1 parent 1dee843 commit 44a0d24

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

t/porting/merge-deltas.t

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
#!perl -w
2+
BEGIN {
3+
chdir "t" if -d "t";
4+
require './test.pl';
5+
@INC = "../lib";
6+
}
17
use v5.36;
2-
use Test2::V0;
3-
4-
my $root = -f 't/TEST' && -f 'MANIFEST' && -d 'lib' && -d 'ext' ? '.' : '..';
58

69
# load the script
7-
do("$root/Porting/merge-deltas.pl") or die $@ || $!;
10+
do("../Porting/merge-deltas.pl") or die $@ || $!;
811

912
# tree_for & as_pod
1013
{
@@ -18,39 +21,28 @@ do("$root/Porting/merge-deltas.pl") or die $@ || $!;
1821
=cut
1922
POD
2023

21-
# just a single test: we're not testing Pod::Simple::SimpleTree
22-
is(
23-
tree_for($pod),
24-
[
25-
Document => { start_line => 1 },
26-
[ head2 => { start_line => 1 }, 'CVE-2025-12345' ],
27-
[ Para => { start_line => 3 }, 'Some CVE was fixed.' ],
28-
[ Para => { start_line => 5 }, 'Found by some person.' ],
29-
],
30-
'tree_for'
31-
);
32-
3324
# as_pod round-trips basic POD
34-
is( as_pod( tree_for($pod) ), $pod, 'as_pod' );
25+
is( as_pod( tree_for($pod) ), $pod, 'as_pod( tree_pod ) round-trips' );
3526
}
3627

3728
# loop_head1
3829
{
39-
my $template_file = "$root/Porting/perldelta_template.pod";
30+
my $template_file = "../Porting/perldelta_template.pod";
4031
my $template = tree_for( slurp($template_file) );
4132

4233
# loop_head1 dies on unexpected =head1
4334
# the callback is only run on the unskipped sections
4435
ok(
45-
lives {
36+
eval {
4637
loop_head1(
4738
[],
4839
$template,
4940
$template_file,
5041
sub ( $master, $title, $template ) {
51-
is( $title, L(), "=head1 $title" );
42+
ok( $title, "=head1 $title" );
5243
}
5344
);
45+
1;
5446
},
5547
'loop_head1'
5648
);

0 commit comments

Comments
 (0)