Commit | Line | Data |
---|---|---|
12db268a TC |
1 | #!perl -w |
2 | use strict; | |
3 | use Test::More; | |
4 | use ExtUtils::Manifest qw(maniread); | |
5 | ||
6 | # RT #74875 | |
7 | my $manifest = maniread(); | |
8 | my @files = grep /\.(c|im|h)$/, sort keys %$manifest; | |
9 | plan tests => scalar @files; | |
10 | ||
11 | ++$|; | |
12 | for my $file (@files) { | |
13 | my $ok = 1; | |
14 | if (open my $fh, "<", $file) { | |
15 | my $in_pod; | |
16 | while (<$fh>) { | |
17 | if (/^=cut/) { | |
18 | if ($in_pod) { | |
19 | $in_pod = 0; | |
20 | } | |
21 | else { | |
22 | diag("$file:$.: found =cut without pod"); | |
23 | $ok = 0; | |
24 | } | |
25 | } | |
26 | elsif (/^=\w+/) { | |
27 | $in_pod = $.; | |
28 | } | |
29 | elsif (m(\*/)) { | |
30 | if ($in_pod) { | |
31 | diag("$file:$.: unclosed pod starting $in_pod"); | |
32 | $ok = 0; | |
33 | } | |
34 | } | |
35 | } | |
36 | close $fh; | |
37 | } | |
38 | else { | |
39 | diag("Cannot open $file: $!"); | |
40 | $ok = 0; | |
41 | } | |
42 | ok($ok, $file); | |
43 | } |