r39816 - in /branches/upstream/libtest-pod-perl/current: Changes MANIFEST META.yml Makefile.PL Pod.pm t/00-load.t t/link.pod t/link.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Mon Jul 13 15:52:17 UTC 2009
Author: jawnsy-guest
Date: Mon Jul 13 15:51:57 2009
New Revision: 39816
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=39816
Log:
[svn-upgrade] Integrating new upstream version, libtest-pod-perl (1.40)
Added:
branches/upstream/libtest-pod-perl/current/t/link.pod
branches/upstream/libtest-pod-perl/current/t/link.t
Modified:
branches/upstream/libtest-pod-perl/current/Changes
branches/upstream/libtest-pod-perl/current/MANIFEST
branches/upstream/libtest-pod-perl/current/META.yml
branches/upstream/libtest-pod-perl/current/Makefile.PL
branches/upstream/libtest-pod-perl/current/Pod.pm
branches/upstream/libtest-pod-perl/current/t/00-load.t
Modified: branches/upstream/libtest-pod-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-perl/current/Changes?rev=39816&op=diff
==============================================================================
--- branches/upstream/libtest-pod-perl/current/Changes (original)
+++ branches/upstream/libtest-pod-perl/current/Changes Mon Jul 13 15:51:57 2009
@@ -1,4 +1,27 @@
Change log for Test::Pod
+
+1.40 - Sun Jul 12 23:32:11 CDT 2009
+ [THINGS THAT MAY BREAK YOUR CODE]
+ Test::Pod now requires Perl 5.8.0.
+
+ [ENHANCEMENTS]
+ Test::Pod now complains about the illegal construct L<text|url>.
+ Thanks to Paul Miller.
+
+ The list of directories to exclude is now much longer, and is
+ available in %Test::Pod::ignore_dirs. This list is right now:
+
+ '.bzr' => 'Bazaar',
+ '.git' => 'Git',
+ '.hg' => 'Mercurial',
+ '.pc' => 'quilt',
+ '.svn' => 'Subversion',
+ CVS => 'CVS',
+ RCS => 'RCS',
+ SCCS => 'SCCS',
+ _darcs => 'darcs',
+ _sgbak => 'Vault/Fortress',
+
1.26 - Wed Jul 19 09:54:48 CDT 2006
Modified: branches/upstream/libtest-pod-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-perl/current/MANIFEST?rev=39816&op=diff
==============================================================================
--- branches/upstream/libtest-pod-perl/current/MANIFEST (original)
+++ branches/upstream/libtest-pod-perl/current/MANIFEST Mon Jul 13 15:51:57 2009
@@ -1,6 +1,6 @@
Changes
+Makefile.PL
MANIFEST
-Makefile.PL
Pod.pm
t/00-load.t
@@ -11,6 +11,8 @@
t/good.t
t/item-ordering.pod
t/item-ordering.t
+t/link.pod
+t/link.t
t/load.t
t/missing-file.t
t/pod.t
Modified: branches/upstream/libtest-pod-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-perl/current/META.yml?rev=39816&op=diff
==============================================================================
--- branches/upstream/libtest-pod-perl/current/META.yml (original)
+++ branches/upstream/libtest-pod-perl/current/META.yml Mon Jul 13 15:51:57 2009
@@ -1,14 +1,24 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Test-Pod
-version: 1.26
-version_from: Pod.pm
-installdirs: site
+--- #YAML:1.0
+name: Test-Pod
+version: 1.40
+abstract: ~
+author: []
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
requires:
- File::Spec: 0
- Pod::Simple: 2.04
- Test::Builder::Tester: 1.02
- Test::More: 0.62
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+ File::Spec: 0
+ Pod::Simple: 3.07
+ Test::Builder::Tester: 1.02
+ Test::More: 0.62
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.52
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libtest-pod-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-perl/current/Makefile.PL?rev=39816&op=diff
==============================================================================
--- branches/upstream/libtest-pod-perl/current/Makefile.PL (original)
+++ branches/upstream/libtest-pod-perl/current/Makefile.PL Mon Jul 13 15:51:57 2009
@@ -5,7 +5,7 @@
'NAME' => 'Test::Pod',
'VERSION_FROM' => 'Pod.pm',
'PREREQ_PM' => {
- 'Pod::Simple' => '2.04',
+ 'Pod::Simple' => '3.07', # required for t/link.t
'Test::More' => '0.62',
'Test::Builder::Tester' => '1.02',
'File::Spec' => 0,
Modified: branches/upstream/libtest-pod-perl/current/Pod.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-perl/current/Pod.pm?rev=39816&op=diff
==============================================================================
--- branches/upstream/libtest-pod-perl/current/Pod.pm (original)
+++ branches/upstream/libtest-pod-perl/current/Pod.pm Mon Jul 13 15:51:57 2009
@@ -1,3 +1,43 @@
+package Test::Pod::_parser;
+use base 'Pod::Simple';
+use strict;
+
+sub _handle_element_start {
+ my($parser, $element_name, $attr_hash_r) = @_;
+
+ # Curiously, Pod::Simple supports L<text|scheme:...> rather well.
+
+ if( $element_name eq "L" and $attr_hash_r->{type} eq "url") {
+ $parser->{_state_of_concern}{'Lurl'} = $attr_hash_r->{to};
+ }
+
+ return $parser->SUPER::_handle_element_start(@_);
+}
+
+sub _handle_element_end {
+ my($parser, $element_name) = @_;
+
+ delete $parser->{_state_of_concern}{'Lurl'}
+ if $element_name eq "L" and exists $parser->{_state_of_concern}{'Lurl'};
+
+ return $parser->SUPER::_handle_element_end(@_);
+}
+
+sub _handle_text {
+ my($parser, $text) = @_;
+ if( my $href = $parser->{_state_of_concern}{'Lurl'} ) {
+ if( $href ne $text ) {
+ my $line = $parser->line_count() -2; # XXX: -2, WHY WHY WHY??
+
+ $parser->whine($line, "L<text|scheme:...> is invalid according to perlpod");
+ }
+ }
+
+ return $parser->SUPER::_handle_text(@_);
+}
+
+1;
+
package Test::Pod;
use strict;
@@ -8,12 +48,11 @@
=head1 VERSION
-Version 1.26
-
-=cut
-
-use vars qw( $VERSION );
-$VERSION = '1.26';
+Version 1.40
+
+=cut
+
+our $VERSION = '1.40';
=head1 SYNOPSIS
@@ -62,11 +101,23 @@
=cut
-use 5.004;
-
-use Pod::Simple;
+use 5.008;
+
use Test::Builder;
use File::Spec;
+
+our %ignore_dirs = (
+ '.bzr' => 'Bazaar',
+ '.git' => 'Git',
+ '.hg' => 'Mercurial',
+ '.pc' => 'quilt',
+ '.svn' => 'Subversion',
+ CVS => 'CVS',
+ RCS => 'RCS',
+ SCCS => 'SCCS',
+ _darcs => 'darcs',
+ _sgbak => 'Vault/Fortress',
+);
my $Test = Test::Builder->new;
@@ -81,6 +132,12 @@
$Test->exported_to($caller);
$Test->plan(@_);
+}
+
+sub _additional_test_pod_specific_checks {
+ my ($ok, $errata, $file) = @_;
+
+ return $ok;
}
=head1 FUNCTIONS
@@ -109,12 +166,14 @@
return;
}
- my $checker = Pod::Simple->new;
+ my $checker = Test::Pod::_parser->new;
$checker->output_string( \my $trash ); # Ignore any output
$checker->parse_file( $file );
my $ok = !$checker->any_errata_seen;
+ $ok = _additional_test_pod_specific_checks( $ok, ($checker->{errata}||={}), $file );
+
$Test->ok( $ok, $name );
if ( !$ok ) {
my $lines = $checker->{errata};
@@ -130,13 +189,14 @@
=head2 all_pod_files_ok( [@files/@directories] )
Checks all the files in C<@files> for valid POD. It runs
-L<all_pod_files()> on each file/directory, and calls the C<plan()> function for you
-(one test for each function), so you can't have already called C<plan>.
-
-If C<@files> is empty or not passed, the function finds all POD files in
-the F<blib> directory if it exists, or the F<lib> directory if not.
-A POD file is one that ends with F<.pod>, F<.pl> and F<.pm>, or any file
-where the first line looks like a shebang line.
+L<all_pod_files()> on each file/directory, and calls the C<plan()>
+function for you (one test for each function), so you can't have
+already called C<plan>.
+
+If C<@files> is empty or not passed, the function finds all POD
+files in the F<blib> directory if it exists, or the F<lib> directory
+if not. A POD file is one that ends with F<.pod>, F<.pl> and F<.pm>,
+or any file where the first line looks like a shebang line.
If you're testing a module, just make a F<t/pod.t>:
@@ -163,9 +223,11 @@
=head2 all_pod_files( [@dirs] )
-Returns a list of all the Perl files in I<$dir> and in directories below.
-If no directories are passed, it defaults to F<blib> if F<blib> exists,
-or else F<lib> if not. Skips any files in CVS or .svn directories.
+Returns a list of all the Perl files in I<$dir> and in directories
+below. If no directories are passed, it defaults to F<blib> if
+F<blib> exists, or else F<lib> if not. Skips any files in CVS,
+.svn, .git and similar directories. See C<%Test::Pod::ignore_dirs>
+for a list of them.
A Perl file is:
@@ -195,7 +257,7 @@
closedir DH;
@newfiles = File::Spec->no_upwards( @newfiles );
- @newfiles = grep { $_ ne "CVS" && $_ ne ".svn" } @newfiles;
+ @newfiles = grep { not exists $ignore_dirs{ $_ } } @newfiles;
foreach my $newfile (@newfiles) {
my $filename = File::Spec->catfile( $file, $newfile );
@@ -223,13 +285,12 @@
my $file = shift;
return 1 if $file =~ /\.PL$/;
- return 1 if $file =~ /\.p(l|m|od)$/;
+ return 1 if $file =~ /\.p(?:l|m|od)$/;
return 1 if $file =~ /\.t$/;
- local *FH;
- open FH, $file or return;
- my $first = <FH>;
- close FH;
+ open my $fh, '<', $file or return;
+ my $first = <$fh>;
+ close $fh;
return 1 if defined $first && ($first =~ /^#!.*perl/);
@@ -253,17 +314,18 @@
=head1 ACKNOWLEDGEMENTS
Thanks to
-David Wheeler
+David Wheeler,
+Paul Miller
and
Peter Edwards
for contributions and to C<brian d foy> for the original code.
=head1 COPYRIGHT
-Copyright 2006, Andy Lester, All Rights Reserved.
-
-You may use, modify, and distribute this package under the
-same terms as Perl itself.
+Copyright 2006-2009, Andy Lester, All Rights Reserved.
+
+You may use, modify, and distribute this package under the terms
+as the Artistic License v2.0 or GNU Public License v2.0.
=cut
Modified: branches/upstream/libtest-pod-perl/current/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-perl/current/t/00-load.t?rev=39816&op=diff
==============================================================================
--- branches/upstream/libtest-pod-perl/current/t/00-load.t (original)
+++ branches/upstream/libtest-pod-perl/current/t/00-load.t Mon Jul 13 15:51:57 2009
@@ -2,10 +2,12 @@
use warnings;
use strict;
-use Test::More tests => 1;
+use Test::More tests => 2;
BEGIN {
use_ok( 'Test::Pod' );
+ use_ok( 'Pod::Simple' );
}
diag( "Testing Test::Pod $Test::Pod::VERSION, Perl $], $^X" );
+diag( "Using Pod::Simple $Pod::Simple::VERSION" );
Added: branches/upstream/libtest-pod-perl/current/t/link.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-perl/current/t/link.pod?rev=39816&op=file
==============================================================================
--- branches/upstream/libtest-pod-perl/current/t/link.pod (added)
+++ branches/upstream/libtest-pod-perl/current/t/link.pod Mon Jul 13 15:51:57 2009
@@ -1,0 +1,25 @@
+
+=head1 COPYRIGHT
+
+Copyright 2009, Paul Miller C<< <jettero at cpan.org> >>
+
+
+... test text, please ignore
+
+=head1 SEE ALSO
+
+... test text, please ignore
+
+Invalid according to L<perlpod/Formatting Codes>:
+L<Paul's Perl Modules|http://voltar.org/perl>
+
+This should be OK:
+
+ L<Paul's Perl Modules|http://voltar.org/perl>
+
+This should also be OK: L<http://voltar.org/perl>
+
+... test text, please ignore
+
+=cut
+
Added: branches/upstream/libtest-pod-perl/current/t/link.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-pod-perl/current/t/link.t?rev=39816&op=file
==============================================================================
--- branches/upstream/libtest-pod-perl/current/t/link.t (added)
+++ branches/upstream/libtest-pod-perl/current/t/link.t Mon Jul 13 15:51:57 2009
@@ -1,0 +1,20 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::Builder::Tester tests => 2;
+use Test::More;
+
+BEGIN {
+ use_ok( 'Test::Pod' );
+}
+
+my $file = 't/link.pod';
+test_out( "not ok 1 - POD test for $file" );
+pod_file_ok( $file );
+test_fail(-1);
+test_diag(
+ "$file (14): L<text|scheme:...> is invalid according to perlpod",
+);
+test_test( "$file is bad" );
More information about the Pkg-perl-cvs-commits
mailing list