diff options
Diffstat (limited to 't/pod')
-rwxr-xr-x | t/pod/special_seqs.t | 2 | ||||
-rw-r--r-- | t/pod/special_seqs.xr | 2 | ||||
-rw-r--r-- | t/pod/testp2pt.pl | 29 |
3 files changed, 19 insertions, 14 deletions
diff --git a/t/pod/special_seqs.t b/t/pod/special_seqs.t index 5352fd1ca6..1b31387dd3 100755 --- a/t/pod/special_seqs.t +++ b/t/pod/special_seqs.t @@ -27,4 +27,6 @@ too: C<$self-E<gt>method()> and C<$self-E<gt>{FIELDNAME}> and C<{FOO=E<gt>BAR}>. Dont forget C<$self-E<gt>method()-E<gt>{FIELDNAME} = {FOO=E<gt>BAR}>. +And make sure that C<0> works too! + =cut diff --git a/t/pod/special_seqs.xr b/t/pod/special_seqs.xr index b6ae7fd5b6..6795de0490 100644 --- a/t/pod/special_seqs.xr +++ b/t/pod/special_seqs.xr @@ -11,3 +11,5 @@ Dont forget `$self->method()->{FIELDNAME} = {FOO=>BAR}'. + And make sure that `0' works too! + diff --git a/t/pod/testp2pt.pl b/t/pod/testp2pt.pl index 140de05a3a..9df5b9f2ed 100644 --- a/t/pod/testp2pt.pl +++ b/t/pod/testp2pt.pl @@ -3,8 +3,9 @@ package TestPodIncPlainText; BEGIN { use File::Basename; use File::Spec; + use Cwd qw(abs_path); push @INC, '..'; - my $THISDIR = dirname $0; + my $THISDIR = abs_path(dirname $0); unshift @INC, $THISDIR; require "testcmp.pl"; import TestCompare; @@ -19,6 +20,7 @@ use vars qw(@ISA @EXPORT $MYPKG); use Carp; use Exporter; #use File::Compare; +#use Cwd qw(abs_path); @ISA = qw(Pod::PlainText); @EXPORT = qw(&testpodplaintext); @@ -30,6 +32,16 @@ $MYPKG = eval { (caller)[0] }; sub catfile(@) { File::Spec->catfile(@_); } +my $INSTDIR = abs_path(dirname $0); +$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, 't', 'pod'), + catfile($INSTDIR, 't', 'pod', 'xtra') + ); + ## Find the path to the file to =include sub findinclude { my $self = shift; @@ -42,19 +54,8 @@ sub findinclude { ## 1. the directory containing this pod file my $thispoddir = dirname $self->input_file; ## 2. the parent directory of the above - my $parentdir = ($thispoddir eq '.') ? '..' : dirname $thispoddir; - ## 3. any Pod/ or scripts/ subdirectory of these two - my @dirs = (); - for ($thispoddir, $parentdir) { - my $dir = $_; - for ( qw(scripts lib) ) { - push @dirs, $dir, catfile($dir, $_), - catfile($dir, 'Pod'), - catfile($dir, $_, 'Pod'); - } - } - my %dirs = (map { ($_ => 1) } @dirs); - my @podincdirs = (sort keys %dirs); + my $parentdir = dirname $thispoddir; + my @podincdirs = ($thispoddir, $parentdir, @PODINCDIRS); for (@podincdirs) { my $incfile = catfile($_, $incname); |