From: Hugo van der Sanden Date: Mon, 2 Dec 2002 02:59:02 +0000 (+0000) Subject: Integrate PodParser-1.20, with matching tweaks to lib/Pod/t/latex.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9c6ed6d7263c1b2c230f35c31c8bcd2eef2d5431;p=p5sagit%2Fp5-mst-13.2.git Integrate PodParser-1.20, with matching tweaks to lib/Pod/t/latex.t and lib/Pod/t/utils.t to cater for simpler output text. p4raw-id: //depot/perl@18224 --- diff --git a/lib/Pod/Checker.pm b/lib/Pod/Checker.pm index 5aca76c..637c415 100644 --- a/lib/Pod/Checker.pm +++ b/lib/Pod/Checker.pm @@ -10,7 +10,7 @@ package Pod::Checker; use vars qw($VERSION); -$VERSION = 1.3; ## Current version of this package +$VERSION = 1.40; ## Current version of this package require 5.005; ## requires this Perl version or later use Pod::ParseUtils; ## for hyperlinks and lists @@ -274,6 +274,11 @@ The NAME section (C<=head1 NAME>) should consist of a single paragraph with the script/module name, followed by a dash `-' and a very short description of what the thing is good for. +=item * =headI without preceding higher level + +For example if there is a C<=head2> in the POD file prior to a +C<=head1>. + =back =head2 Hyperlinks @@ -548,6 +553,7 @@ sub initialize { ## Initialize number of errors, and setup an error function to ## increment this number and then print to the designated output. $self->{_NUM_ERRORS} = 0; + $self->{_NUM_WARNINGS} = 0; $self->{-quiet} ||= 0; # set the error handling subroutine $self->errorsub($self->{-quiet} ? sub { 1; } : 'poderror'); @@ -609,6 +615,8 @@ sub poderror { ## Increment error count and print message " ++($self->{_NUM_ERRORS}) if(!%opts || ($opts{-severity} && $opts{-severity} eq 'ERROR')); + ++($self->{_NUM_WARNINGS}) + if(!%opts || ($opts{-severity} && $opts{-severity} eq 'WARNING')); my $out_fh = $self->output_handle() || \*STDERR; print $out_fh ($severity, $msg, $line, $file, "\n") if($self->{-warnings} || !%opts || $opts{-severity} ne 'WARNING'); @@ -628,6 +636,18 @@ sub num_errors { ################################## +=item C<$checker-Enum_warnings()> + +Set (if argument specified) and retrieve the number of warnings found. + +=cut + +sub num_warnings { + return (@_ > 1) ? ($_[0]->{_NUM_WARNINGS} = $_[1]) : $_[0]->{_NUM_WARNINGS}; +} + +################################## + =item C<$checker-Ename()> Set (if argument specified) and retrieve the canonical name of POD as @@ -907,17 +927,24 @@ sub command { } } elsif($cmd =~ /^head(\d+)/) { + my $hnum = $1; + $self->{"_have_head_$hnum"}++; # count head types + if($hnum > 1 && !$self->{"_have_head_".($hnum -1)}) { + $self->poderror({ -line => $line, -file => $file, + -severity => 'WARNING', + -msg => "=head$hnum without preceding higher level"}); + } # check whether the previous =head section had some contents if(defined $self->{_commands_in_head} && $self->{_commands_in_head} == 0 && defined $self->{_last_head} && - $self->{_last_head} >= $1) { + $self->{_last_head} >= $hnum) { $self->poderror({ -line => $line, -file => $file, -severity => 'WARNING', -msg => "empty section in previous paragraph"}); } $self->{_commands_in_head} = -1; - $self->{_last_head} = $1; + $self->{_last_head} = $hnum; # check if there is an open list if(@{$self->{_list_stack}}) { my $list; diff --git a/lib/Pod/ParseUtils.pm b/lib/Pod/ParseUtils.pm index db615a5..18e9626 100644 --- a/lib/Pod/ParseUtils.pm +++ b/lib/Pod/ParseUtils.pm @@ -10,7 +10,7 @@ package Pod::ParseUtils; use vars qw($VERSION); -$VERSION = 0.22; ## Current version of this package +$VERSION = 0.30; ## Current version of this package require 5.005; ## requires this Perl version or later =head1 NAME @@ -284,7 +284,7 @@ sub parse { my $self = shift; local($_) = $_[0]; # syntax check the link and extract destination - my ($alttext,$page,$node,$type) = (undef,'','',''); + my ($alttext,$page,$node,$type,$quoted) = (undef,'','','',0); $self->{_warnings} = []; @@ -311,7 +311,7 @@ sub parse { # problem: a lot of people use (), or (1) or the like to indicate # man page sections. But this collides with L that is supposed # to point to an internal funtion... - my $page_rx = '[\w.]+(?:::[\w.]+)*(?:[(](?:\d\w*|)[)]|)'; + my $page_rx = '[\w.-]+(?:::[\w.-]+)*(?:[(](?:\d\w*|)[)]|)'; # page name only if(m!^($page_rx)$!o) { $page = $1; @@ -321,6 +321,7 @@ sub parse { elsif(m!^(.*?)\s*[|]\s*($page_rx)\s*/\s*"(.+)"$!o) { ($alttext, $page, $node) = ($1, $2, $3); $type = 'section'; + $quoted = 1; #... therefore | and / are allowed } # alttext and page elsif(m!^(.*?)\s*[|]\s*($page_rx)$!o) { @@ -331,11 +332,13 @@ sub parse { elsif(m!^(.*?)\s*[|]\s*(?:/\s*|)"(.+)"$!) { ($alttext, $node) = ($1,$2); $type = 'section'; + $quoted = 1; } # page and "section" elsif(m!^($page_rx)\s*/\s*"(.+)"$!o) { ($page, $node) = ($1, $2); $type = 'section'; + $quoted = 1; } # page and item elsif(m!^($page_rx)\s*/\s*(.+)$!o) { @@ -346,6 +349,7 @@ sub parse { elsif(m!^/?"(.+)"$!) { $node = $1; $type = 'section'; + $quoted = 1; } # only item elsif(m!^\s*/(.+)$!) { @@ -392,7 +396,7 @@ sub parse { if($page =~ /[(]\w*[)]$/) { $self->warning("(section) in '$page' deprecated"); } - if($node =~ m:[|/]:) { + if(!$quoted && $node =~ m:[|/]:) { $self->warning("node '$node' contains non-escaped | or /"); } if($alttext =~ m:[|/]:) { @@ -422,11 +426,9 @@ sub _construct_text { $self->{_text} = $section; } else { - $self->{_text} = (!$section ? '' : - $type eq 'item' ? "the $section entry" : - "the section on $section" ) . - ($page ? ($section ? ' in ':'') . "the $page$page_ext manpage" : - ' elsewhere in this document'); + $self->{_text} = ($section || '') . + (($page && $section) ? ' in ' : '') . + "$page$page_ext"; } # for being marked up later # use the non-standard markers P<> and Q<>, so that the resulting @@ -439,11 +441,8 @@ sub _construct_text { $self->{_markup} = "Q<$section>"; } else { - $self->{_markup} = (!$section ? '' : - $type eq 'item' ? "the Q<$section> entry" : - "the section on Q<$section>" ) . - ($page ? ($section ? ' in ':'') . "the P<$page>$page_ext manpage" : - ' elsewhere in this document'); + $self->{_markup} = (!$section ? '' : "Q<$section>") . + ($page ? ($section ? ' in ':'') . "P<$page>$page_ext" : ''); } } @@ -469,10 +468,10 @@ but without markers (read only). Depending on the link type this is one of the following alternatives (the + and * denote the portions of the text that are marked up): - the +perl+ manpage - the *$|* entry in the +perlvar+ manpage - the section on *OPTIONS* in the +perldoc+ manpage - the section on *DESCRIPTION* elsewhere in this document + +perl+ L + *$|* in +perlvar+ L + *OPTIONS* in +perldoc+ L + *DESCRIPTION* L<"DESCRIPTION"> =cut diff --git a/lib/Pod/Usage.pm b/lib/Pod/Usage.pm index 9898a97..771cff4 100644 --- a/lib/Pod/Usage.pm +++ b/lib/Pod/Usage.pm @@ -506,7 +506,7 @@ sub pod2usage { and $opts{"-output"} == \*STDOUT ) { ## spit out the entire PODs. Might as well invoke perldoc - my $progpath = File::Spec->catfile($Config{scriptdir}, "perldoc"); + my $progpath = File::Spec->catfile($Config{bin}, "perldoc"); system($progpath, $opts{"-input"}); } else { diff --git a/lib/Pod/t/latex.t b/lib/Pod/t/latex.t index dd3323b..b35e864 100644 --- a/lib/Pod/t/latex.t +++ b/lib/Pod/t/latex.t @@ -142,11 +142,11 @@ it refers to \texttt{Pod::LaTeX}: \textsf{test}. -Standard link: the \emph{Pod::LaTeX} manpage. +Standard link: \emph{Pod::LaTeX}. -Now refer to an external section: the section on \textsf{sec} in the \emph{Pod::LaTeX} manpage +Now refer to an external section: \textsf{sec} in \emph{Pod::LaTeX} \section{Lists\label{Lists}\index{Lists}} diff --git a/lib/Pod/t/utils.t b/lib/Pod/t/utils.t index 202ffd9..4a1b8a1 100644 --- a/lib/Pod/t/utils.t +++ b/lib/Pod/t/utils.t @@ -27,11 +27,11 @@ my @links = qw{ }; my @results = ( - "the P manpage", - "the Q entry in the P manpage", - "the section on Q in the P manpage", - "the section on Q elsewhere in this document", - "the section on Q elsewhere in this document", + "P", + "Q in P", + "Q in P", + "Q", + "Q", "Q", "Q", "Q", diff --git a/pod/podselect.PL b/pod/podselect.PL index 7f72830..b6b8c9b 100644 --- a/pod/podselect.PL +++ b/pod/podselect.PL @@ -72,7 +72,7 @@ Print the manual page and exit. =item B<-section>S< >I Specify a section to include in the output. -See L +See L for the format to use for I. This option may be given multiple times on the command line. diff --git a/t/pod/emptycmd.t b/t/pod/emptycmd.t index 815eba2..59e395e 100755 --- a/t/pod/emptycmd.t +++ b/t/pod/emptycmd.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/for.t b/t/pod/for.t index 4af528a..44af44f 100755 --- a/t/pod/for.t +++ b/t/pod/for.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/headings.t b/t/pod/headings.t index 365aa7d..78608d0 100755 --- a/t/pod/headings.t +++ b/t/pod/headings.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/include.t b/t/pod/include.t index b6f1e31..4e73b78 100755 --- a/t/pod/include.t +++ b/t/pod/include.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/included.t b/t/pod/included.t index a25b37b..4f171c4 100755 --- a/t/pod/included.t +++ b/t/pod/included.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/lref.t b/t/pod/lref.t index 1dd8c68..02e2c9e 100755 --- a/t/pod/lref.t +++ b/t/pod/lref.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/lref.xr b/t/pod/lref.xr index 61c1206..297053b 100644 --- a/t/pod/lref.xr +++ b/t/pod/lref.xr @@ -1,22 +1,22 @@ Try out *LOTS* of different ways of specifying references: - Reference the "section" in manpage + Reference the the section entry in the manpage manpage - Reference the "section" in manpage + Reference the the section entry in the manpage manpage - Reference the "section" in manpage + Reference the the section entry in the manpage manpage - Reference the "section" in manpage + Reference the the section entry in the manpage manpage - Reference the "manpage/section" + Reference the the section on "manpage/section" - Reference the "section" in "manpage" + Reference the the section entry in the "manpage" manpage - Reference the "section" in manpage + Reference the the section on "section" in the manpage manpage - Reference the "section" in manpage + Reference the the section entry in the manpage manpage - Reference the "section" in manpage + Reference the the section entry in the manpage manpage Now try it using the new "|" stuff ... diff --git a/t/pod/multiline_items.t b/t/pod/multiline_items.t index 334832d..0fe410a 100755 --- a/t/pod/multiline_items.t +++ b/t/pod/multiline_items.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/multiline_items.xr b/t/pod/multiline_items.xr index 9eea63a..dddf05f 100644 --- a/t/pod/multiline_items.xr +++ b/t/pod/multiline_items.xr @@ -3,4 +3,3 @@ Test multiline item lists appropriately. This is a test. - diff --git a/t/pod/nested_items.t b/t/pod/nested_items.t index 0b86702..c8e9b22 100755 --- a/t/pod/nested_items.t +++ b/t/pod/nested_items.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/nested_seqs.t b/t/pod/nested_seqs.t index 9f30533..8559f1f 100755 --- a/t/pod/nested_seqs.t +++ b/t/pod/nested_seqs.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/oneline_cmds.t b/t/pod/oneline_cmds.t index bba0e4a..28bd1d0 100755 --- a/t/pod/oneline_cmds.t +++ b/t/pod/oneline_cmds.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/pod2usage.t b/t/pod/pod2usage.t index 70cbacd..cf2c31b 100755 --- a/t/pod/pod2usage.t +++ b/t/pod/pod2usage.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/pod2usage.xr b/t/pod/pod2usage.xr index 82749bf..7315d40 100644 --- a/t/pod/pod2usage.xr +++ b/t/pod/pod2usage.xr @@ -41,10 +41,10 @@ DESCRIPTION specifed than standard input is read. pod2usage invokes the pod2usage() function in the Pod::Usage module. - Please see "pod2usage()" in Pod::Usage. + Please see the pod2usage() entry in the Pod::Usage manpage. SEE ALSO - Pod::Usage, pod2text(1) + the Pod::Usage manpage, the pod2text(1) manpage AUTHOR Brad Appleton diff --git a/t/pod/poderrs.t b/t/pod/poderrs.t index 526c98b..98c6320 100755 --- a/t/pod/poderrs.t +++ b/t/pod/poderrs.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testpchk.pl"; import TestPodChecker; } @@ -17,6 +17,7 @@ exit( ($passed == 1) ? 0 : -1 ) unless $ENV{HARNESS_ACTIVE}; __END__ +=head2 This should cause a warning =head1 NAME @@ -177,7 +178,7 @@ bla is evil blub is evil -=head2 reoccurrence +=head2 reoccurence =over 4 @@ -193,6 +194,16 @@ we already have a head Misc previous section is empty! +=head1 LINK TESTS + +Due to bug reported by Rafael Garcia-Suarez "rgarciasuarez@free.fr": + +The following hyperlinks : +L<"I/O Operators"> +L +trigger a podchecker warning (using bleadperl) : + node 'I/O Operators' contains non-escaped | or / + =cut diff --git a/t/pod/poderrs.xr b/t/pod/poderrs.xr index 327b2e0..de337b9 100644 --- a/t/pod/poderrs.xr +++ b/t/pod/poderrs.xr @@ -1,46 +1,49 @@ -*** ERROR: Unknown command 'unknown1' at line 25 in file t/pod/poderrs.t -*** ERROR: Unknown interior-sequence 'Q' at line 29 in file t/pod/poderrs.t -*** ERROR: Unknown interior-sequence 'A' at line 30 in file t/pod/poderrs.t -*** ERROR: Unknown interior-sequence 'Y' at line 31 in file t/pod/poderrs.t -*** ERROR: Unknown interior-sequence 'V' at line 31 in file t/pod/poderrs.t -*** ERROR: unterminated B<...> at line 35 in file t/pod/poderrs.t -*** ERROR: unterminated I<...> at line 34 in file t/pod/poderrs.t -*** ERROR: unterminated C<...> at line 37 in file t/pod/poderrs.t -*** WARNING: line containing nothing but whitespace in paragraph at line 45 in file t/pod/poderrs.t -*** ERROR: =item without previous =over at line 52 in file t/pod/poderrs.t -*** ERROR: =back without previous =over at line 56 in file t/pod/poderrs.t -*** ERROR: =over on line 60 without closing =back (at head2) at line 64 in file t/pod/poderrs.t -*** ERROR: =end without =begin at line 66 in file t/pod/poderrs.t -*** ERROR: Nested =begin's (first at line 70:html) at line 72 in file t/pod/poderrs.t -*** ERROR: =end without =begin at line 76 in file t/pod/poderrs.t -*** ERROR: No argument for =begin at line 82 in file t/pod/poderrs.t -*** ERROR: =for without formatter specification at line 88 in file t/pod/poderrs.t -*** ERROR: nested commands C<...C<...>...> at line 94 in file t/pod/poderrs.t -*** ERROR: garbled entity E at line 98 in file t/pod/poderrs.t -*** ERROR: garbled entity E> at line 99 in file t/pod/poderrs.t -*** ERROR: garbled entity E> at line 100 in file t/pod/poderrs.t -*** ERROR: Entity number out of range E<0x100> at line 101 in file t/pod/poderrs.t -*** ERROR: Entity number out of range E<07777> at line 102 in file t/pod/poderrs.t -*** ERROR: Entity number out of range E<300> at line 103 in file t/pod/poderrs.t -*** ERROR: malformed link L<> : empty link at line 115 in file t/pod/poderrs.t -*** WARNING: ignoring leading whitespace in link at line 116 in file t/pod/poderrs.t -*** WARNING: ignoring trailing whitespace in link at line 117 in file t/pod/poderrs.t -*** WARNING: (section) in 'passwd(5)' deprecated at line 123 in file t/pod/poderrs.t -*** WARNING: node '$|' contains non-escaped | or / at line 124 in file t/pod/poderrs.t -*** WARNING: alternative text '$|' contains non-escaped | or / at line 124 in file t/pod/poderrs.t -*** ERROR: Spurious character(s) after =back at line 130 in file t/pod/poderrs.t -*** ERROR: Nonempty Z<> at line 144 in file t/pod/poderrs.t -*** ERROR: Empty X<> at line 146 in file t/pod/poderrs.t -*** WARNING: preceding non-item paragraph(s) at line 152 in file t/pod/poderrs.t -*** WARNING: No argument for =item at line 154 in file t/pod/poderrs.t -*** WARNING: previous =item has no contents at line 156 in file t/pod/poderrs.t -*** WARNING: No items in =over (at line 164) / =back list at line 166 in file t/pod/poderrs.t -*** ERROR: Spurious text after =pod at line 172 in file t/pod/poderrs.t -*** ERROR: Spurious text after =cut at line 176 in file t/pod/poderrs.t -*** WARNING: empty section in previous paragraph at line 192 in file t/pod/poderrs.t -*** ERROR: unresolved internal link 'begin or begin' at line 107 in file t/pod/poderrs.t -*** ERROR: unresolved internal link 'end with begin' at line 108 in file t/pod/poderrs.t -*** ERROR: unresolved internal link 'OoPs' at line 109 in file t/pod/poderrs.t -*** ERROR: unresolved internal link 'abc def' at line 113 in file t/pod/poderrs.t +*** WARNING: =head2 without preceding higher level at line 20 in file t/pod/poderrs.t +*** WARNING: empty section in previous paragraph at line 22 in file t/pod/poderrs.t +*** ERROR: Unknown command 'unknown1' at line 26 in file t/pod/poderrs.t +*** ERROR: Unknown interior-sequence 'Q' at line 30 in file t/pod/poderrs.t +*** ERROR: Unknown interior-sequence 'A' at line 31 in file t/pod/poderrs.t +*** ERROR: Unknown interior-sequence 'Y' at line 32 in file t/pod/poderrs.t +*** ERROR: Unknown interior-sequence 'V' at line 32 in file t/pod/poderrs.t +*** ERROR: unterminated B<...> at line 36 in file t/pod/poderrs.t +*** ERROR: unterminated I<...> at line 35 in file t/pod/poderrs.t +*** ERROR: unterminated C<...> at line 38 in file t/pod/poderrs.t +*** WARNING: line containing nothing but whitespace in paragraph at line 46 in file t/pod/poderrs.t +*** ERROR: =item without previous =over at line 53 in file t/pod/poderrs.t +*** ERROR: =back without previous =over at line 57 in file t/pod/poderrs.t +*** ERROR: =over on line 61 without closing =back (at head2) at line 65 in file t/pod/poderrs.t +*** ERROR: =end without =begin at line 67 in file t/pod/poderrs.t +*** ERROR: Nested =begin's (first at line 71:html) at line 73 in file t/pod/poderrs.t +*** ERROR: =end without =begin at line 77 in file t/pod/poderrs.t +*** ERROR: No argument for =begin at line 83 in file t/pod/poderrs.t +*** ERROR: =for without formatter specification at line 89 in file t/pod/poderrs.t +*** ERROR: nested commands C<...C<...>...> at line 95 in file t/pod/poderrs.t +*** ERROR: garbled entity E at line 99 in file t/pod/poderrs.t +*** ERROR: garbled entity E> at line 100 in file t/pod/poderrs.t +*** ERROR: garbled entity E> at line 101 in file t/pod/poderrs.t +*** ERROR: Entity number out of range E<0x100> at line 102 in file t/pod/poderrs.t +*** ERROR: Entity number out of range E<07777> at line 103 in file t/pod/poderrs.t +*** ERROR: Entity number out of range E<300> at line 104 in file t/pod/poderrs.t +*** ERROR: malformed link L<> : empty link at line 116 in file t/pod/poderrs.t +*** WARNING: ignoring leading whitespace in link at line 117 in file t/pod/poderrs.t +*** WARNING: ignoring trailing whitespace in link at line 118 in file t/pod/poderrs.t +*** WARNING: (section) in 'passwd(5)' deprecated at line 124 in file t/pod/poderrs.t +*** WARNING: node '$|' contains non-escaped | or / at line 125 in file t/pod/poderrs.t +*** WARNING: alternative text '$|' contains non-escaped | or / at line 125 in file t/pod/poderrs.t +*** ERROR: Spurious character(s) after =back at line 131 in file t/pod/poderrs.t +*** ERROR: Nonempty Z<> at line 145 in file t/pod/poderrs.t +*** ERROR: Empty X<> at line 147 in file t/pod/poderrs.t +*** WARNING: preceding non-item paragraph(s) at line 153 in file t/pod/poderrs.t +*** WARNING: No argument for =item at line 155 in file t/pod/poderrs.t +*** WARNING: previous =item has no contents at line 157 in file t/pod/poderrs.t +*** WARNING: No items in =over (at line 165) / =back list at line 167 in file t/pod/poderrs.t +*** ERROR: Spurious text after =pod at line 173 in file t/pod/poderrs.t +*** ERROR: Spurious text after =cut at line 177 in file t/pod/poderrs.t +*** WARNING: empty section in previous paragraph at line 193 in file t/pod/poderrs.t +*** ERROR: unresolved internal link 'begin or begin' at line 108 in file t/pod/poderrs.t +*** ERROR: unresolved internal link 'end with begin' at line 109 in file t/pod/poderrs.t +*** ERROR: unresolved internal link 'OoPs' at line 110 in file t/pod/poderrs.t +*** ERROR: unresolved internal link 'abc def' at line 114 in file t/pod/poderrs.t +*** ERROR: unresolved internal link 'I/O Operators' at line 202 in file t/pod/poderrs.t *** WARNING: multiple occurrence of link target 'Misc' at line - in file t/pod/poderrs.t -t/pod/poderrs.t has 33 pod syntax errors. +t/pod/poderrs.t has 34 pod syntax errors. diff --git a/t/pod/podselect.t b/t/pod/podselect.t index 5d45cdb..0004548 100755 --- a/t/pod/podselect.t +++ b/t/pod/podselect.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/podselect.xr b/t/pod/podselect.xr index ee5fef0..7d1188d 100644 --- a/t/pod/podselect.xr +++ b/t/pod/podselect.xr @@ -12,10 +12,10 @@ OPTIONS AND ARGUMENTS -man Print the manual page and exit. -section *section-spec* - Specify a section to include in the output. See "SECTION - SPECIFICATIONS" in Pod::Select for the format to use for - *section-spec*. This option may be given multiple times on the - command line. + Specify a section to include in the output. See the section on + "SECTION SPECIFICATIONS" in the Pod::Parser manpage for the + format to use for *section-spec*. This option may be given + multiple times on the command line. *file* The pathname of a file from which to select sections of pod documentation (defaults to standard input). @@ -27,10 +27,11 @@ DESCRIPTION are given than all pod sections encountered are output. podselect invokes the podselect() function exported by Pod::Select - Please see "podselect()" in Pod::Select for more details. + Please see the podselect() entry in the Pod::Select manpage for more + details. SEE ALSO - Pod::Parser and Pod::Select + the Pod::Parser manpage and the Pod::Select manpage AUTHOR Brad Appleton diff --git a/t/pod/special_seqs.t b/t/pod/special_seqs.t index c6b2ce1..ecd99ec 100755 --- a/t/pod/special_seqs.t +++ b/t/pod/special_seqs.t @@ -1,7 +1,7 @@ BEGIN { - chdir 't' if -d 't'; - unshift @INC, '../lib'; - unshift @INC, './pod'; + use File::Basename; + my $THISDIR = dirname $0; + unshift @INC, $THISDIR; require "testp2pt.pl"; import TestPodIncPlainText; } diff --git a/t/pod/special_seqs.xr b/t/pod/special_seqs.xr index d5c43fe..a8c715a 100644 --- a/t/pod/special_seqs.xr +++ b/t/pod/special_seqs.xr @@ -1,4 +1,4 @@ - This is a test to see if I can do not only $self and `method()', but + This is a test to see if I can do not only `$self' and `method()', but also `$self->method()' and `$self->{FIELDNAME}' and `$Foo <=> $Bar' without resorting to escape sequences. If I want to refer to the right-shift operator I can do something like `$x >> 3' or even `$y >> @@ -13,7 +13,7 @@ Dont forget `$self->method()->{FIELDNAME} = {FOO=>BAR}'. - And make sure that 0 works too! + And make sure that `0' works too! Now, if I use << or >> as my delimiters, then I have to use whitespace. So things like `<$self-'method()>> and `<$self-'{FIELDNAME}>> wont end diff --git a/t/pod/testp2pt.pl b/t/pod/testp2pt.pl index f432719..bec55e4 100644 --- a/t/pod/testp2pt.pl +++ b/t/pod/testp2pt.pl @@ -24,14 +24,8 @@ use vars qw($MYPKG @EXPORT @ISA); $MYPKG = eval { (caller)[0] }; @EXPORT = qw(&testpodplaintext); BEGIN { - if ( $] >= 5.005_58 ) { - require Pod::Text; - @ISA = qw( Pod::Text ); - } - else { - require Pod::PlainText; - @ISA = qw( Pod::PlainText ); - } + require Pod::PlainText; + @ISA = qw( Pod::PlainText ); require VMS::Filespec if $^O eq 'VMS'; } @@ -42,30 +36,15 @@ BEGIN { sub catfile(@) { File::Spec->catfile(@_); } my $INSTDIR = abs_path(dirname $0); -if ($^O eq 'VMS') { # clean up directory spec - $INSTDIR = VMS::Filespec::unixpath($INSTDIR); - $INSTDIR =~ s#/$##; - $INSTDIR =~ s#/000000/#/#; -} - -if ($^O eq 'VMS') { - # File::Spec::VMS::splitdir doesn't work on Unix syntax filespecs, but - # on VMS syntax filespecs dirname returns (as documented) the directory - # part of the path (NOT the parent directory, as is assumed in this script). - $INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod'); - $INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't'); -} -else { - $INSTDIR = (dirname $INSTDIR) if ((File::Spec->splitdir($INSTDIR))[-1] eq 'pod'); - $INSTDIR = (dirname $INSTDIR) if ((File::Spec->splitdir($INSTDIR))[-1] eq 't'); -} - +$INSTDIR = VMS::Filespec::unixpath($INSTDIR) if $^O eq 'VMS'; +$INSTDIR =~ s#/$## if $^O eq 'VMS'; +$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod'); +$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't'); my @PODINCDIRS = ( catfile($INSTDIR, 'lib', 'Pod'), catfile($INSTDIR, 'scripts'), catfile($INSTDIR, 'pod'), catfile($INSTDIR, 't', 'pod') ); -print "PODINCDIRS = ",join(', ',@PODINCDIRS),"\n"; ## Find the path to the file to =include sub findinclude { @@ -121,7 +100,7 @@ sub begin_input { sub podinc2plaintext( $ $ ) { my ($infile, $outfile) = @_; local $_; - my $text_parser = $MYPKG->new(quotes => "`'"); + my $text_parser = $MYPKG->new; $text_parser->parse_from_file($infile, $outfile); } @@ -167,7 +146,7 @@ sub testpodplaintext( @ ) { for $podfile (@testpods) { ($testname, $_) = fileparse($podfile); $testdir ||= $_; - $testname =~ s/\..*$//; + $testname =~ s/\.t$//; $cmpfile = $testdir . $testname . '.xr'; $outfile = $testdir . $testname . '.OUT';