]> git.imager.perl.org - imager.git/blame - xt/x50cpod.t
and the release date
[imager.git] / xt / x50cpod.t
CommitLineData
12db268a
TC
1#!perl -w
2use strict;
3use Test::More;
4use ExtUtils::Manifest qw(maniread);
5
6# RT #74875
7my $manifest = maniread();
8my @files = grep /\.(c|im|h)$/, sort keys %$manifest;
9plan tests => scalar @files;
10
11++$|;
12for 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}