diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-11 04:06:10 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-11 04:06:10 +0000 |
commit | 7b43481ac511739e974f51e515e10117bf13eca5 (patch) | |
tree | 32a06a083d62275547acd82663f0ead2e02e18da /t/pod/find.t | |
parent | 108626240d40b101564eeaa420b6665df7a0654f (diff) | |
download | perl-7b43481ac511739e974f51e515e10117bf13eca5.tar.gz |
Add a few missing files, update MANIFEST.
p4raw-id: //depot/perl@6600
Diffstat (limited to 't/pod/find.t')
-rw-r--r-- | t/pod/find.t | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/t/pod/find.t b/t/pod/find.t new file mode 100644 index 0000000000..b33d876b1d --- /dev/null +++ b/t/pod/find.t @@ -0,0 +1,69 @@ +# Testing of Pod::Find +# Author: Marek Rouchal <marek@saftsack.fs.uni-bayreuth.de> + +$| = 1; + +use Test; + +BEGIN { plan tests => 4 } + +use Pod::Find qw(pod_find pod_where); +use File::Spec; + +# load successful +ok(1); + +require Cwd; +my $THISDIR = Cwd::cwd(); +my $VERBOSE = 0; + +print "*** searching $THISDIR/lib\n"; +my %pods = pod_find("$THISDIR/lib"); +my $result = join(',', sort values %pods); +print "*** found $result\n"; +my $compare = join(',', qw( + Pod::Checker + Pod::Find + Pod::InputObjects + Pod::ParseUtils + Pod::Parser + Pod::PlainText + Pod::Select + Pod::Usage +)); +ok($result,$compare); + +# File::Find is located in this place since eons +# and on all platforms, hopefully + +print "*** searching for File::Find\n"; +$result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'File::Find') + || 'undef - pod not found!'; +print "*** found $result\n"; + +require Config; +$compare = File::Spec->catfile($Config::Config{privlib},"File","Find.pm"); +ok(_canon($result),_canon($compare)); + +# Search for a documentation pod rather than a module +print "*** searching for perlfunc.pod\n"; +$result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'perlfunc') + || 'undef - perlfunc.pod not found!'; +print "*** found $result\n"; + +$compare = File::Spec->catfile($Config::Config{privlib},"perlfunc.pod"); +ok(_canon($result),_canon($compare)); + +# make the path as generic as possible +sub _canon +{ + my ($path) = @_; + $path = File::Spec->canonpath($path); + my @comp = File::Spec->splitpath($path); + my @dir = File::Spec->splitdir($comp[1]); + $comp[1] = File::Spec->catdir(@dir); + $path = File::Spec->catpath(@dir); + $path = uc($path) if File::Spec->case_tolerant; + $path; +} + |