On Tue, Aug 28, 2001 at 07:56:30PM -0400, Kirrily 'Skud' Robert wrote:
> Checking POD coverage...
> Test::Simple 33% *************
> Test::Harness 33% *************
That's actually correct, as there are only three public-looking
functions in Test::Simple. Ditto Test::Harness.
> Term::ReadKey 0%
This might be helped by doing:
--- Coverage.orig Tue Aug 28 20:39:04 2001
+++ lib/Pod/Coverage.pm Tue Aug 28 20:39:42 2001
@@ -181,7 +181,7 @@
my ($command, $text, $line_num) = @_;
if ($command eq 'item' || $command =~ /^head(?:2|3|4)/) {
# lose trailing newlines, and take note
- return unless $text =~ /(.*)/;
+ return unless $text =~ /^\s*(\S+)/;
push @{$self->{identifiers}}, $1;
}
}
Term::ReadKey has a Pod::Coverage rating of 0.318181818181818
The following are uncovered: bootstrap, Win32PeekChar, GetSpeed, GetTermSizeVIO,
GetTermSizeWin32, termoptions, setnodelay, GetTermSizeGWINSZ, SetReadMode,
GetTermSizeGSIZE, termsizeoptions, selectfile, pollfile, normalizehandle, blockoptions
Better. If we skip bootstrap...
--- Coverage.orig Tue Aug 28 20:39:04 2001
+++ lib/Pod/Coverage.pm Tue Aug 28 20:39:42 2001
@@ -77,7 +77,7 @@
my %args = @_;
my $class = ref $referent || $referent;
- my $private = $args{private} || [ qr/^_/, qr/^import$/, qr/^DESTROY/,
qr/^AUTOLOAD/, @{ $args{also_private} || [] } ];
+ my $private = $args{private} || [ qr/^_/, qr/^import$/, qr/^DESTROY/,
+qr/^AUTOLOAD/, qr/^bootstrap$/, @{ $args{also_private} || [] } ];
my $self = bless { @_, private => $private }, $class;
}
that's a little better. The rest are valid private functions from XS
that could be better named.
Here's another suggestion. You could check to see if the module ISA
Exporter and only consider the exportable functions for POD coverage.
UNIVERSAL::exports will tell you what's exportable.
If you could feed Pod::Coverage a code ref to evaluate what's private
and what's not...
require UNIVERSAL::exports;
Pod::Coverage->new(package => "Foo",
private_check => sub {
my($pack, $func) = @_;
if( $pack->isa('Exporter') ) {
return !$pack->exports($func);
}
else {
return 0;
}
},
);
private_check would be called for anything not explicitly declared
private.
Or provide this as a switch.
Pod::Coverage->new(package => "Foo", only_exportable => 1);
private_check would be useful on it's own, though.
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
In other words, any prophecy from God is guaranteed to be accurate, and any
prophecy which is not from God but given in his name shall guarantee the death
of the prophet. I am risking my life to tell you this.
--Alex Chiu, Immortality Guy