From: Steve Hay Date: Wed, 4 Feb 2009 16:45:11 +0000 (+0000) Subject: Upgrade to Pod-Parser-1.37. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b2bdce690895574a192de0ae0dd992853e38c29;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Pod-Parser-1.37. Two local changes remain: part of the change to t/pod/pod2usage2.t in http://perl5.git.perl.org/perl.git/commitdiff/767c16a part of the change to lib/Pod/t/contains_pod.t in http://perl5.git.perl.org/perl.git/commitdiff/fb59f97 --- diff --git a/lib/Pod/Checker.pm b/lib/Pod/Checker.pm index deac5de..a230542 100644 --- a/lib/Pod/Checker.pm +++ b/lib/Pod/Checker.pm @@ -11,7 +11,7 @@ package Pod::Checker; use strict; use vars qw($VERSION @ISA @EXPORT %VALID_COMMANDS %VALID_SEQUENCES); -$VERSION = '1.44_01'; ## Current version of this package +$VERSION = '1.45'; ## Current version of this package require 5.005; ## requires this Perl version or later use Pod::ParseUtils; ## for hyperlinks and lists diff --git a/lib/Pod/Parser.pm b/lib/Pod/Parser.pm index 5e261a6..c807f3f 100644 --- a/lib/Pod/Parser.pm +++ b/lib/Pod/Parser.pm @@ -12,7 +12,7 @@ use strict; ## These "variables" are used as local "glob aliases" for performance use vars qw($VERSION @ISA %myData %myOpts @input_stack); -$VERSION = '1.36_01'; ## Current version of this package +$VERSION = '1.37'; ## Current version of this package require 5.005; ## requires this Perl version or later ############################################################################# @@ -996,7 +996,7 @@ sub parse_paragraph { " in paragraph at line $line in file $myData{_INFILE}\n"; (ref $errorsub) and &{$errorsub}($errmsg) or (defined $errorsub) and $self->$errorsub($errmsg) - or warn($errmsg); + or carp($errmsg); } if (length $cmd) { diff --git a/lib/Pod/PlainText.pm b/lib/Pod/PlainText.pm index 05e5866..0dce179 100644 --- a/lib/Pod/PlainText.pm +++ b/lib/Pod/PlainText.pm @@ -29,7 +29,7 @@ use vars qw(@ISA %ESCAPES $VERSION); # by Pod::Usage. @ISA = qw(Pod::Select); -$VERSION = '2.03'; +$VERSION = '2.04'; BEGIN { if ($] < 5.006) { @@ -312,6 +312,7 @@ sub cmd_head2 { if ($$self{alt}) { $self->output ("\n== $_ ==\n\n"); } else { + $_ .= "\n" if $$self{loose}; $self->output (' ' x ($$self{indent} / 2) . $_ . "\n"); } } @@ -325,6 +326,7 @@ sub cmd_head3 { if ($$self{alt}) { $self->output ("\n= $_ =\n"); } else { + $_ .= "\n" if $$self{loose}; $self->output (' ' x ($$self{indent}) . $_ . "\n"); } } @@ -643,12 +645,11 @@ C<=over> blocks. Defaults to 4. =item loose -If set to a true value, a blank line is printed after a C<=head1> heading. -If set to false (the default), no blank line is printed after C<=head1>, -although one is still printed after C<=head2>. This is the default because -it's the expected formatting for manual pages; if you're formatting -arbitrary text documents, setting this to true may result in more pleasing -output. +If set to a true value, a blank line is printed after a C<=headN> headings. +If set to false (the default), no blank line is printed after C<=headN>. +This is the default because it's the expected formatting for manual pages; +if you're formatting arbitrary text documents, setting this to true may +result in more pleasing output. =item sentence diff --git a/lib/Pod/t/contains_pod.t b/lib/Pod/t/contains_pod.t index b7d0831..25cce53 100644 --- a/lib/Pod/t/contains_pod.t +++ b/lib/Pod/t/contains_pod.t @@ -5,7 +5,6 @@ # $Id$ use strict; - BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @@ -15,7 +14,6 @@ BEGIN { } } - use Test::More tests => 2; use Pod::Find qw( contains_pod ); diff --git a/t/pod/find.t b/t/pod/find.t index 6582dbb..bfd66cd 100644 --- a/t/pod/find.t +++ b/t/pod/find.t @@ -14,19 +14,15 @@ BEGIN { $| = 1; -use Test; +use Test::More tests => 4; BEGIN { - plan tests => 4; - use File::Spec; + # 1. load successful + use_ok('Pod::Find', qw(pod_find pod_where)); } -use Pod::Find qw(pod_find pod_where); use File::Spec; -# load successful -ok(1); - require Cwd; my $THISDIR = Cwd::cwd(); my $VERBOSE = $ENV{PERL_CORE} ? 0 : ($ENV{TEST_VERBOSE} || 0); @@ -60,7 +56,7 @@ if ($^O eq 'VMS') { $unix_mode = ($vms_efs && $vms_unix_rpt); } -print "### searching $lib_dir\n"; +print "### 2. searching $lib_dir\n"; my %pods = pod_find($lib_dir); my $result = join(',', sort values %pods); print "### found $result\n"; @@ -91,16 +87,16 @@ if ($^O eq 'VMS') { foreach(@compare) { $count += grep {/$_/} @result; } - ok($count/($#result+1)-1,$#compare); + is($count/($#result+1)-1,$#compare); } elsif (File::Spec->case_tolerant || $^O eq 'dos') { - ok(lc $result,lc $compare); + is(lc $result,lc $compare); } else { - ok($result,$compare); + is($result,$compare); } -print "### searching for File::Find\n"; +print "### 3. searching for File::Find\n"; $result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'File::Find') || 'undef - pod not found!'; print "### found $result\n"; @@ -114,18 +110,28 @@ if ($^O eq 'VMS') { # privlib is perl_root:[lib] OK but not under mms } $result =~ s/perl_root:\[\-?\.?//i; $result =~ s/\[\-?\.?//i; # needed under `mms test` - ok($result,$compare); + is($result,$compare); } else { $compare = $ENV{PERL_CORE} ? File::Spec->catfile(File::Spec->updir, 'lib','File','Find.pm') : File::Spec->catfile($Config::Config{privlibexp},"File","Find.pm"); - ok(_canon($result),_canon($compare)); + my $resfile = _canon($result); + my $cmpfile = _canon($compare); + if($^O =~ /dos|win32/i && $resfile =~ /~\d(?=\\|$)/) { + # we have ~1 short filenames + $resfile = quotemeta($resfile); + $resfile =~ s/\\~\d(?=\\|$)/[^\\\\]+/g; + ok($cmpfile =~ /^$resfile$/, "pod_where found File::Find (with long filename matching)") || + diag("'$cmpfile' does not match /^$resfile\$/"); + } else { + is($resfile,$cmpfile,"pod_where found File::Find"); + } } # Search for a documentation pod rather than a module my $searchpod = 'Stuff'; -print "### searching for $searchpod.pod\n"; +print "### 4. searching for $searchpod.pod\n"; $result = pod_where( { -dirs => [ File::Spec->catdir( $ENV{PERL_CORE} ? () : qw(t), 'pod', 'testpods', 'lib', 'Pod') ], @@ -136,7 +142,8 @@ print "### found $result\n"; $compare = File::Spec->catfile( $ENV{PERL_CORE} ? () : qw(t), 'pod', 'testpods', 'lib', 'Pod' ,'Stuff.pm'); -ok(_canon($result),_canon($compare)); +is(_canon($result),_canon($compare)); + # make the path as generic as possible sub _canon diff --git a/t/pod/pod2usage2.t b/t/pod/pod2usage2.t index 4cd75de..bb06ed5 100644 --- a/t/pod/pod2usage2.t +++ b/t/pod/pod2usage2.t @@ -164,7 +164,7 @@ if ($ENV{PERL_CORE}) { $pod_file2 = File::Spec->catfile(qw(t pod usage2.pod)); } -($exit, $text) = getoutput( sub { system($^X, $blib, $test_script); exit($? >> 8); } ); +($exit, $text) = getoutput( sub { system($^X, $blib, $test_script); exit($? >> 8); } ); $text =~ s{#Using.*/blib.*\n}{}; # older blib's emit something to STDERR is ($exit, 17, "Exit status pod2usage (-verbose => 2, -input => \*DATA)"); ok (compare ($text, <<'EOT'), "Output test pod2usage (-verbose => 2, -input => \*DATA)") or diag "Got:\n$text\n"; diff --git a/t/pod/usage2.pod b/t/pod/usage2.pod index 1e03b7d..5c4817b 100644 --- a/t/pod/usage2.pod +++ b/t/pod/usage2.pod @@ -1,56 +1,56 @@ -=head1 Heading-1 - -=over 100 - -=item One - -=item Two - -=back - -=head2 Heading 2 - -Some text - -=head1 BugHeader - -Some text - -=head2 BugHeader2 - -=over 4 - -=item More - -=item Still More - -=back - -=head1 Heading-2 - -=head2 Heading-2.2 - -More text. - -=head1 OPTIONS AND ARGUMENTS - -=head2 Arguments - -The required arguments (which typically follow any options on the -command line) are: - -=over - -=item I - -=item I - -=back - -=head2 Options - -Options may be abbreviated. Options which take values may be separated -from the values by whitespace or the "=" character. - -=cut - +=head1 Heading-1 + +=over 100 + +=item One + +=item Two + +=back + +=head2 Heading 2 + +Some text + +=head1 BugHeader + +Some text + +=head2 BugHeader2 + +=over 4 + +=item More + +=item Still More + +=back + +=head1 Heading-2 + +=head2 Heading-2.2 + +More text. + +=head1 OPTIONS AND ARGUMENTS + +=head2 Arguments + +The required arguments (which typically follow any options on the +command line) are: + +=over + +=item I + +=item I + +=back + +=head2 Options + +Options may be abbreviated. Options which take values may be separated +from the values by whitespace or the "=" character. + +=cut +