diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-13 21:08:29 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-13 21:08:29 +0000 |
commit | 828c4421567f1da54062ec5edfcc3250be409b16 (patch) | |
tree | b8d7b34222aba963b38218e73d3b93673d3b2803 /t/pod | |
parent | 635bab04a8e9700ca0cd2791a5f46a400e5d5a55 (diff) | |
download | perl-828c4421567f1da54062ec5edfcc3250be409b16.tar.gz |
updates from PodParser v1.12 on CPAN (from Brad Appleton)
p4raw-id: //depot/perl@5711
Diffstat (limited to 't/pod')
-rw-r--r-- | t/pod/testp2pt.pl | 9 | ||||
-rw-r--r-- | t/pod/testpchk.pl | 19 |
2 files changed, 25 insertions, 3 deletions
diff --git a/t/pod/testp2pt.pl b/t/pod/testp2pt.pl index 22bbaf8247..2ff8aa427a 100644 --- a/t/pod/testp2pt.pl +++ b/t/pod/testp2pt.pl @@ -44,13 +44,12 @@ sub catfile(@) { File::Spec->catfile(@_); } my $INSTDIR = abs_path(dirname $0); $INSTDIR = VMS::Filespec::unixpath($INSTDIR) if $^O eq 'VMS'; $INSTDIR =~ s#/$## if $^O eq 'VMS'; -$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'xtra'); $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'), - catfile($INSTDIR, 't', 'pod', 'xtra') + catfile($INSTDIR, 't', 'pod') ); ## Find the path to the file to =include @@ -100,6 +99,10 @@ sub command { print $out_fh "###### end =include $incbase #####\n" if ($incdebug); } +sub begin_input { + $_[0]->{_INFILE} = VMS::Filespec::unixify($_[0]->{_INFILE}) if $^O eq 'VMS'; +} + sub podinc2plaintext( $ $ ) { my ($infile, $outfile) = @_; local $_; diff --git a/t/pod/testpchk.pl b/t/pod/testpchk.pl index 640226bde7..94c0c10fe5 100644 --- a/t/pod/testpchk.pl +++ b/t/pod/testpchk.pl @@ -10,6 +10,7 @@ BEGIN { import TestCompare; my $PARENTDIR = dirname $THISDIR; push @INC, map { File::Spec->catfile($_, 'lib') } ($PARENTDIR, $THISDIR); + require VMS::Filespec if $^O eq 'VMS'; } use Pod::Checker; @@ -30,7 +31,20 @@ sub stripname( $ ) { } sub msgcmp( $ $ ) { + ## filter out platform-dependent aspects of error messages my ($line1, $line2) = @_; + for ($line1, $line2) { + if ( /^#*\s*(\S.*?)\s+(?:has \d+\s*)?pod syntax (?:error|OK)/ ) { + my $fname = $1; + s/^#*\s*// if ($^O eq 'MacOS'); + s/^\s*\Q$fname\E/stripname($fname)/e; + } + elsif ( /^#*\s*\*+\s*(?:ERROR|Unterminated)/ ) { + s/^#*\s*// if ($^O eq 'MacOS'); + s/of file\s+(\S.*?)\s*$/"of file ".stripname($1)/e; + s/at\s+(\S.*?)\s+line/"at ".stripname($1)." line"/e; + } + } return $line1 ne $line2; } @@ -51,6 +65,11 @@ sub testpodcheck( @ ) { print "# Running podchecker for '$testname'...\n"; ## Compare the output against the expected result + if ($^O eq 'VMS') { + for ($infile, $outfile, $cmpfile) { + $_ = VMS::Filespec::unixify($_) unless ref; + } + } podchecker($infile, $outfile); if ( testcmp({'-cmplines' => \&msgcmp}, $outfile, $cmpfile) ) { $different = "$outfile is different from $cmpfile"; |