9 use Pod::Simple::Search;
11 BEGIN { plan tests => 10 }
14 ": Testing limit_glob ...\n";
16 my $x = Pod::Simple::Search->new;
17 die "Couldn't make an object!?" unless ok defined $x;
25 print "# CWD: $cwd\n";
29 if ($ENV{PERL_CORE}) {
30 my $updir = File::Spec->updir;
31 my $dir = File::Spec->catdir($updir, 'lib', 'Pod', 'Simple', 't');
32 return File::Spec->catdir ($dir, $file);
38 my($here1, $here2, $here3);
40 if( -e ($here1 = source_path( 'testlib1' ))) {
41 die "But where's $here2?"
42 unless -e ($here2 = source_path( 'testlib2'));
43 die "But where's $here3?"
44 unless -e ($here3 = source_path( 'testlib3'));
46 } elsif( -e ($here1 = File::Spec->catdir($cwd, 't', 'testlib1' ))) {
47 die "But where's $here2?"
48 unless -e ($here2 = File::Spec->catdir($cwd, 't', 'testlib2'));
49 die "But where's $here3?"
50 unless -e ($here3 = File::Spec->catdir($cwd, 't', 'testlib3'));
53 die "Can't find the test corpora";
55 print "# OK, found the test corpora\n# as $here1\n# and $here2\n# and $here3\n#\n";
58 print $x->_state_as_string;
62 *pretty = \&Pod::Simple::BlackBox::pretty;
65 print "# Limiting to $glob\n";
66 $x->limit_glob($glob);
68 my($name2where, $where2name) = $x->survey($here1, $here2, $here3);
70 my $p = pretty( $where2name, $name2where )."\n";
76 my $names = join "|", sort keys %$name2where;
77 skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
79 "squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo";
83 my $names = join "|", sort values %$where2name;
84 skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
86 "squaa|squaa::Glunk|squaa::Vliff|squaa::Vliff|squaa::Vliff|squaa::Wowo";
89 for(values %$where2name) { ++$count{$_} };
90 #print pretty(\%count), "\n\n";
91 delete @count{ grep $count{$_} < 2, keys %count };
92 my $shadowed = join "|", sort keys %count;
93 ok $shadowed, "squaa::Vliff";
95 sub thar { print "# Seen $_[0] :\n", map "# {$_}\n", sort grep $where2name->{$_} eq $_[0],keys %$where2name; return; }
97 ok $count{'squaa::Vliff'}, 3;
102 ok $name2where->{'squaa'}; # because squaa.pm IS squaa*
104 ok( ($name2where->{'squaa::Vliff'} || 'huh???'), '/[^\^]testlib1/' );
106 skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
107 ($name2where->{'squaa::Wowo'} || 'huh???'),
111 print "# OK, bye from ", __FILE__, "\n";