9 use Pod::Simple::Search;
11 BEGIN { plan tests => 11 }
14 ": Testing the scanning of several (well, two) docroots...\n";
16 my $x = Pod::Simple::Search->new;
17 die "Couldn't make an object!?" unless ok defined $x;
22 print "# ", join(" ", map "{$_}", @_), "\n";
29 print "# CWD: $cwd\n";
33 if ($ENV{PERL_CORE}) {
34 my $updir = File::Spec->updir;
35 my $dir = File::Spec->catdir($updir, 'lib', 'Pod', 'Simple', 't');
36 return File::Spec->catdir ($dir, $file);
43 if( -e ($here1 = source_path('testlib1'))) {
44 die "But where's $here2?"
45 unless -e ($here2 = source_path('testlib2'));
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'));
50 die "Can't find the test corpora";
52 print "# OK, found the test corpora\n# as $here1\n# and $here2\n";
55 print $x->_state_as_string;
59 *pretty = \&Pod::Simple::BlackBox::pretty;
61 print "# OK, starting run...\n# [[\n";
62 my($name2where, $where2name) = $x->survey($here1, $here2);
63 print "# ]]\n#OK, run done.\n";
65 my $p = pretty( $where2name, $name2where )."\n";
71 my $names = join "|", sort values %$where2name;
72 skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
74 "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik";
78 my $names = join "|", sort keys %$name2where;
79 skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
81 "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik";
84 ok( ($name2where->{'squaa'} || 'huh???'), '/squaa\.pm$/');
86 ok grep( m/squaa\.pm/, keys %$where2name ), 1;
88 ###### Now with recurse(0)
92 print "# OK, starting run without recurse...\n# [[\n";
93 ($name2where, $where2name) = $x->survey($here1, $here2);
94 print "# ]]\n#OK, run without recurse done.\n";
96 $p = pretty( $where2name, $name2where )."\n";
102 my $names = join "|", sort values %$where2name;
103 skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
105 "Blorm|Suzzle|squaa|zikzik";
109 my $names = join "|", sort keys %$name2where;
110 skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
112 "Blorm|Suzzle|squaa|zikzik";
115 ok( ($name2where->{'squaa'} || 'huh???'), '/squaa\.pm$/');
117 ok grep( m/squaa\.pm/, keys %$where2name ), 1;