-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from kenneth-olwing/master
Make case sensitivity user settable
- Loading branch information
Showing
5 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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$}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
=head1 x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
=head1 X |