1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
BEGIN {
if($ENV{PERL_CORE}) {
chdir 't';
@INC = '../lib';
}
}
use strict;
use Pod::Simple::Search;
use Test;
BEGIN { plan tests => 4 }
print "# ", __FILE__,
": Testing forced case sensitivity ...\n";
my $x = Pod::Simple::Search->new;
die "Couldn't make an object!?" unless ok defined $x;
$x->inc(0);
$x->is_case_insensitive(0);
use File::Spec;
use Cwd;
my $cwd = cwd();
print "# CWD: $cwd\n";
sub source_path {
my $file = shift;
if ($ENV{PERL_CORE}) {
my $updir = File::Spec->updir;
my $dir = File::Spec->catdir($updir, 'lib', 'Pod', 'Simple', 't');
return File::Spec->catdir ($dir, $file);
} else {
return $file;
}
}
my($A, $B);
if( -e ($A = source_path( 'search60/A' ))) {
die "But where's $B?"
unless -e ($B = source_path( 'search60/B'));
} elsif( -e ($A = File::Spec->catdir($cwd, 't', 'search60', 'A' ))) {
die "But where's $B?"
unless -e ($B = File::Spec->catdir($cwd, 't', 'search60', 'B'));
} else {
die "Can't find the test corpora";
}
print "# OK, found the test corpora\n# as $A\n# and $B\n#\n";
ok 1;
my($name2where, $where2name) = $x->survey($A, $B);
ok ($name2where->{x} =~ m{^\Q$A\E[\\/]x\.pod$});
ok ($name2where->{X} =~ m{^\Q$B\E[\\/]X\.pod$});
|