make sure the method index includes all documented Imager methods and
authorTony Cook <tony@develop=help.com>
Tue, 4 Jul 2006 12:52:08 +0000 (12:52 +0000)
committerTony Cook <tony@develop=help.com>
Tue, 4 Jul 2006 12:52:08 +0000 (12:52 +0000)
is properly sorted.

Imager.pm
t/t93podcover.t

index 090a8b88417692dd752b804073d21c41f70a03ab..5a7287ce74df1dc07bab01ee1a9ae3de634016eb 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -3589,10 +3589,10 @@ addcolors() -  L<Imager::ImageTypes/addcolors>
 
 addtag() -  L<Imager::ImageTypes/addtag> - add image tags
 
-arc() - L<Imager::Draw/arc>
-
 align_string() - L<Imager::Draw/align_string>
 
+arc() - L<Imager::Draw/arc>
+
 bits() - L<Imager::ImageTypes/bits> - number of bits per sample for the
 image
 
@@ -3637,6 +3637,8 @@ get_file_limits() - L<Imager::Files/"Limiting the sizes of images you read">
 
 getheight() - L<Imager::ImageTypes/getwidth>
 
+getmask() - L<Imager::ImageTypes/getmask>
+
 getpixel() - L<Imager::Draw/getpixel>
 
 getsamples() - L<Imager::Draw/getsamples>
@@ -3647,8 +3649,12 @@ getwidth() - L<Imager::ImageTypes/getwidth>
 
 img_set() - L<Imager::ImageTypes/img_set>
 
+init() - L<Imager::ImageTypes/init>
+
 line() - L<Imager::Draw/line>
 
+load_plugin() - L<Imager::Filters/load_plugin>
+
 map() - L<Imager::Transformations/"Color Mappings"> - remap color
 channel values
 
@@ -3658,8 +3664,18 @@ matrix_transform() - L<Imager::Engines/matrix_transform>
 
 maxcolors() - L<Imager::ImageTypes/maxcolors>
 
+NC() - L<Imager::Handy/NC>
+
 new() - L<Imager::ImageTypes/new>
 
+newcolor() - L<Imager::Handy/newcolor>
+
+newcolour() - L<Imager::Handy/newcolour>
+
+newfont() - L<Imager::Handy/newfont>
+
+NF() - L<Imager::Handy/NF>
+
 open() - L<Imager::Files> - an alias for read()
 
 parseiptc() - L<Imager::Files/parseiptc> - parse IPTC data from a JPEG
@@ -3676,6 +3692,12 @@ read() - L<Imager::Files> - read a single image from an image file
 read_multi() - L<Imager::Files> - read multiple images from an image
 file
 
+register_filter() - L<Imager::Filters/register_filter>
+
+register_reader() - L<Imager::Filters/register_reader>
+
+register_writer() - L<Imager::Filters/register_writer>
+
 rotate() - L<Imager::Transformations/rotate>
 
 rubthrough() - L<Imager::Transformations/rubthrough> - draw an image onto an
@@ -3690,14 +3712,16 @@ scaleY() - L<Imager::Transformations/scaleY>
 setcolors() - L<Imager::ImageTypes/setcolors> - set palette colors in
 a paletted image
 
+set_file_limits() - L<Imager::Files/"Limiting the sizes of images you read">
+
+setmask() - L<Imager::ImageTypes/setmask>
+
 setpixel() - L<Imager::Draw/setpixel>
 
 setscanline() - L<Imager::Draw/setscanline>
 
 settag() - L<Imager::ImageTypes/settag>
 
-set_file_limits() - L<Imager::Files/"Limiting the sizes of images you read">
-
 string() - L<Imager::Draw/string> - draw text on an image
 
 tags() -  L<Imager::ImageTypes/tags> - fetch image tags
@@ -3712,6 +3736,8 @@ transform2() - L<Imager::Engines/"transform2">
 
 type() -  L<Imager::ImageTypes/type> - type of image (direct vs paletted)
 
+unload_plugin() - L<Imager::Filters/unload_plugin>
+
 virtual() - L<Imager::ImageTypes/virtual> - whether the image has it's own
 data
 
index 87d91c117bab245fbbd3f37941f4c1a007e2f9a3..d12d02cbd1ea5bf3633cd9ab99d8215e4a8cb78e 100644 (file)
@@ -21,10 +21,11 @@ my @private =
    '^malloc_state$',
    '^init_log$',
    '^polybezier$', # not ready for public consumption
+   '^border$', # I don't know what it is, expect it to go away
   );
 my @trustme = ( '^open$',  );
 
-plan tests => 15;
+plan tests => 17;
 
 {
   pod_coverage_ok('Imager', { also_private => \@private,
@@ -51,3 +52,42 @@ plan tests => 15;
   pod_coverage_ok('Imager::Transform');
 }
 
+{
+  # check all documented methods/functions are in the method index
+  my $coverage = 
+    Pod::Coverage::Imager->new(package => 'Imager',
+                              pod_from => \@pods,
+                              trustme => \@trustme,
+                              also_private => \@private);
+  my %methods = map { $_ => 1 } $coverage->covered;
+  open IMAGER, "< Imager.pm"
+    or die "Cannot open Imager.pm: $!";
+  while (<IMAGER>) {
+    last if /^=head1 METHOD INDEX/;
+  }
+  my @indexed;
+  while (<IMAGER>) {
+    last if /^=\w/;
+
+    if (/^(\w+)\(/) {
+      push @indexed, $1;
+      delete $methods{$1};
+    }
+  }
+
+  unless (is(keys %methods, 0, "all methods in method index")) {
+    print "# the following methods are documented but not in the index:\n";
+    print "#  $_\n" for sort keys %methods;
+  }
+
+  sub dict_cmp_func;
+  is_deeply(\@indexed, [ sort dict_cmp_func @indexed ],
+           "check method index is alphabetically sorted");
+}
+
+sub dict_cmp_func {
+  (my $tmp_a = lc $a) =~ tr/_//d;
+  (my $tmp_b = lc $b) =~ tr/_//d;
+
+  $tmp_a cmp $tmp_b;
+}