1use strict;
2use warnings;
3use Pod::Simple::Search;
4use Test::More tests => 3;
5
6#
7#  "kleene" rhymes with "zany".  It's a fact!
8#
9
10
11print "# ", __FILE__,
12 ": Testing limit_glob ...\n";
13
14my $x = Pod::Simple::Search->new;
15die "Couldn't make an object!?" unless ok defined $x;
16
17$x->inc(0);
18$x->shadows(1);
19
20use File::Spec;
21use Cwd ();
22use File::Basename ();
23
24my $t_dir = File::Basename::dirname(Cwd::abs_path(__FILE__));
25
26my $here1 = File::Spec->catdir($t_dir, 'testlib1');
27my $here2 = File::Spec->catdir($t_dir, 'testlib2');
28my $here3 = File::Spec->catdir($t_dir, 'testlib3');
29
30print "# OK, found the test corpora\n#  as $here1\n# and $here2\n# and $here3\n#\n";
31
32print $x->_state_as_string;
33#$x->verbose(12);
34
35use Pod::Simple;
36*pretty = \&Pod::Simple::BlackBox::pretty;
37
38my $glob = '*k';
39print "# Limiting to $glob\n";
40$x->limit_glob($glob);
41
42my($name2where, $where2name) = $x->survey($here1, $here2, $here3);
43
44my $p = pretty( $where2name, $name2where )."\n";
45$p =~ s/, +/,\n/g;
46$p =~ s/^/#  /mg;
47print $p;
48
49require File::Spec->catfile($t_dir, 'ascii_order.pl');
50
51{
52my $names = join "|", sort ascii_order keys %$name2where;
53is $names, "Zonk::Pronk|hinkhonk::Glunk|perlzuk|squaa::Glunk|zikzik";
54}
55
56{
57my $names = join "|", sort ascii_order values %$where2name;
58is $names, "Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Glunk|perlzuk|squaa::Glunk|zikzik";
59}
60