[rt #85413] add a test for standard POD headings and fix the errors found
authorTony Cook <tony@develop-help.com>
Sun, 19 May 2013 02:44:31 +0000 (12:44 +1000)
committerTony Cook <tony@develop-help.com>
Sun, 19 May 2013 02:44:31 +0000 (12:44 +1000)
lib/Imager/Engines.pod
lib/Imager/Expr.pm
lib/Imager/Files.pod
lib/Imager/ImageTypes.pod
lib/Imager/Install.pod
lib/Imager/Probe.pm
lib/Imager/Transform.pm
lib/Imager/interface.pod
lib/Imager/regmach.pod
t/950-kwalitee/060-podstruct.t [new file with mode: 0644]

index 71b1a4da3f91d12c33866d7a99490e51f9a4ab28..34b06980acbc18f5b3885962c7253aaf4f3c6eba 100644 (file)
@@ -570,4 +570,8 @@ image.
 
 =back
 
+=head1 AUTHOR
+
+Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
+
 =cut
index 69b84d78e81004913e3cbd2abaae15567cd98813..3e1a41e97bab73d2fd922ae452d068fe2c32f60a 100644 (file)
@@ -4,7 +4,7 @@ use Imager::Regops;
 use strict;
 use vars qw($VERSION);
 
-$VERSION = "1.005";
+$VERSION = "1.006";
 
 my %expr_types;
 
@@ -696,4 +696,8 @@ we add some sort of jump, the existing optimizer will need to be
 rewritten, and any optimization you perform may well be broken too
 (well, your code generation will probably be broken anyway <sigh>).
 
+=head1 AUTHOR
+
+Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
+
 =cut
index 0732d9f61c48045fd910ed2cfd0540244b23df2c..b5e70e23c01d7e7781a22d0baaefd5eed5a66d48 100644 (file)
@@ -1968,4 +1968,8 @@ only 2 colors used - it will have a 128 color table anyway.
 
 Imager(3)
 
+=head1 AUTHOR
+
+Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
+
 =cut
index 39101b9186d2fc214afeaae41ad95089f8e7add0..80ac92b4268bb9cf361f290bed9cdddaab428904 100644 (file)
@@ -1248,13 +1248,9 @@ Returns a true value if logging is enabled.
 
 =back
 
-=head1 REVISION
+=head1 AUTHOR
 
-$Revision$
-
-=head1 AUTHORS
-
-Tony Cook, Arnar M. Hrafnkelsson
+Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
 
 =head1 SEE ALSO
 
index 131ca49f9e7820852e48c71dbfa7bd8f45f957de..5e8234bd910134334601acb847bb06e132f9f226 100644 (file)
@@ -11,7 +11,7 @@ Imager::Install - installation notes for Imager
   make test
   make install
 
-=head1 CONFIGURATION
+=head1 DESCRIPTION
 
 Assuming you have all of your required libraries in the places Imager
 looks, you should be able to use the standard mantra:
@@ -404,4 +404,8 @@ Ideally, C<freetype-config> should be in the PATH when building Imager
 with freetype 2.x support, in which case L<Imager::Font::FT2> can
 configure itself.
 
-=cut
\ No newline at end of file
+=head1 AUTHOR
+
+Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
+
+=cut
index d59b6c181cbdd40d5d0c24fd557c535653c7384a..781e1ca24b914aacf1d3b43fe91c29d73404267f 100644 (file)
@@ -4,7 +4,7 @@ use File::Spec;
 use Config;
 use Cwd ();
 
-our $VERSION = "1.001";
+our $VERSION = "1.002";
 
 my @alt_transfer = qw/altname incsuffix libbase/;
 
@@ -623,4 +623,8 @@ an alternative defaults to the value from the main configuration.
 
 =back
 
+=head1 AUTHOR
+
+Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
+
 =cut
index ae55c1d03ce92aacd86dbd622052ff6b299f92be..43a18166be5edf298b2592adf57a5d4e59069ba9 100644 (file)
@@ -4,7 +4,7 @@ use Imager;
 use Imager::Expr::Assem;
 use vars qw($VERSION);
 
-$VERSION = "1.005";
+$VERSION = "1.006";
 
 my %funcs =
   (
@@ -531,4 +531,8 @@ Needs more transformations.
 
 Imager(3), F<transform.perl>
 
+=head1 AUTHOR
+
+Tony Cook <tonyc@cpan.org>
+
 =cut
index 0162e93580465639e0411140fe5288431eb204e8..eca4ea02c50db87c98a60470a035af3773a88ac8 100644 (file)
@@ -323,7 +323,7 @@ If this is not the case then these functions will just crash :)
 
 =head2 Sample macros
 
-C<Imagei.h> defines several macros for converting samples between
+C<imagei.h> defines several macros for converting samples between
 different sizes.
 
 Each macro is of the form C<Sample>I<size>C<To>I<size> where I<size> is one
@@ -345,4 +345,8 @@ of 8, 16, or F (for floating-point samples).
 
 =back
 
+=head1 AUTHOR
+
+Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
+
 =cut
index a4b0f7fe611561448a67f98d30eee2773b1eff98..105d977335f7117eb8192a70af62937ea9bf69e6 100644 (file)
@@ -99,5 +99,9 @@ performance loss.
 If you feed bad 'machine code' to the register machine, you have a
 good chance of a C<SIGSEGV>.
 
+=head1 AUTHOR
+
+Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
+
 =cut
 
diff --git a/t/950-kwalitee/060-podstruct.t b/t/950-kwalitee/060-podstruct.t
new file mode 100644 (file)
index 0000000..837d0c2
--- /dev/null
@@ -0,0 +1,101 @@
+#!perl -w
+use strict;
+use Test::More;
+$ENV{AUTOMATED_TESTING} || $ENV{IMAGER_AUTHOR_TESTING}
+  or plan skip_all => "POD only tested under automated or author testing";
+BEGIN {
+  eval 'use Pod::Parser 1.50;';
+  plan skip_all => "Pod::Parser 1.50 required for podlinkcheck" if $@;
+}
+use File::Find;
+use File::Spec::Functions qw(rel2abs abs2rel splitdir);
+
+# this test is intended to catch errors like in
+# https://rt.cpan.org/Ticket/Display.html?id=85413
+
+my @pod; # files with pod
+
+my $base = rel2abs("blib/lib");
+
+my @files;
+find(sub {
+       -f && /\.(pod|pm)$/
+        and push @files, $File::Find::name;
+     }, $base);
+
+my %item_in;
+
+for my $file (@files) {
+  my $parser = PodPreparse->new;
+
+  $parser->parse_from_file($file);
+  if ($parser->{is_pod}) {
+    push @pod, $file;
+  }
+}
+
+plan tests =>  2 * scalar(@pod);
+
+my @req_head1s = qw(NAME DESCRIPTION AUTHOR);
+
+for my $file (@pod) {
+  my $parser = PodStructCheck->new;
+  my $relfile = abs2rel($file, $base);
+  $parser->{bad_quotes} = [];
+  $parser->parse_from_file($file);
+
+  my @missing;
+  for my $head (@req_head1s) {
+    push @missing, $head unless $parser->{head1s}{$head};
+  }
+
+  unless (ok(!@missing, "$relfile: check missing headers")) {
+    diag "$relfile: missing head1s @missing\n";
+  }
+  unless (ok(!@{$parser->{bad_quotes}}, "$relfile: check for bad quotes")) {
+    diag "$relfile:$_->[1]: bad quote in: $_->[0]"
+      for @{$parser->{bad_quotes}};
+  }
+}
+
+package PodPreparse;
+BEGIN { our @ISA = qw(Pod::Parser); }
+
+sub command {
+  my ($self, $cmd, $para) = @_;
+
+  $self->{is_pod} = 1;
+}
+
+sub verbatim {}
+
+sub textblock {}
+
+package PodStructCheck;
+BEGIN { our @ISA = qw(Pod::Parser); }
+
+sub command {
+  my ($self, $command, $paragraph, $line_num) = @_;
+
+  if ($command eq "head1") {
+    $paragraph =~ s/\s+\z//;
+    $self->{head1s}{$paragraph} = 1;
+
+    if ($paragraph =~ /\A[^']*'\z/
+       || $paragraph =~ /\A[^"]*"\z/
+       || $paragraph =~ /\A'[^']*\z/
+       || $paragraph =~ /\A"[^"]*\z/) {
+      push @{$self->{bad_quotes}}, [ $paragraph, $line_num ];
+    }
+  }
+}
+
+sub verbatim {}
+
+sub textblock {
+}
+
+sub sequence {
+}
+
+