xref: /openbsd-src/gnu/usr.bin/perl/cpan/Pod-Simple/t/search28.t (revision 3d61058aa5c692477b6d18acfbbdb653a9930ff9)
1b39c5158Smillertuse strict;
2eac174f2Safresh1use warnings;
3b39c5158Smillertuse Pod::Simple::Search;
4*3d61058aSafresh1use Test::More tests => 2;
5b39c5158Smillert
6b39c5158Smillertprint "# ", __FILE__,
7b39c5158Smillert ": Testing limit_glob ...\n";
8b39c5158Smillert
9b39c5158Smillertmy $x = Pod::Simple::Search->new;
10b39c5158Smillertdie "Couldn't make an object!?" unless ok defined $x;
11b39c5158Smillert
12b39c5158Smillert$x->inc(0);
13b39c5158Smillert$x->shadows(1);
14b39c5158Smillert
15b39c5158Smillertuse File::Spec;
16*3d61058aSafresh1use Cwd ();
17*3d61058aSafresh1use File::Basename ();
18b39c5158Smillert
19*3d61058aSafresh1my $t_dir = File::Basename::dirname(Cwd::abs_path(__FILE__));
20b39c5158Smillert
21*3d61058aSafresh1my $here1 = File::Spec->catdir($t_dir, 'testlib1');
22*3d61058aSafresh1my $here2 = File::Spec->catdir($t_dir, 'testlib2');
23*3d61058aSafresh1my $here3 = File::Spec->catdir($t_dir, 'testlib3');
24b39c5158Smillert
25b39c5158Smillertprint "# OK, found the test corpora\n#  as $here1\n# and $here2\n# and $here3\n#\n";
26b39c5158Smillert
27b39c5158Smillertprint $x->_state_as_string;
28b39c5158Smillert#$x->verbose(12);
29b39c5158Smillert
30b39c5158Smillertuse Pod::Simple;
31b39c5158Smillert*pretty = \&Pod::Simple::BlackBox::pretty;
32b39c5158Smillert
33b39c5158Smillertmy $glob = '*z*k*';
34b39c5158Smillertprint "# Limiting to $glob\n";
35b39c5158Smillert$x->limit_glob($glob);
36b39c5158Smillert
37b39c5158Smillertmy($name2where, $where2name) = $x->survey($here1, $here2, $here3);
38b39c5158Smillert
39b39c5158Smillertmy $p = pretty( $where2name, $name2where )."\n";
40b39c5158Smillert$p =~ s/, +/,\n/g;
41b39c5158Smillert$p =~ s/^/#  /mg;
42b39c5158Smillertprint $p;
43b39c5158Smillert
44*3d61058aSafresh1require File::Spec->catfile($t_dir, 'ascii_order.pl');
45b8851fccSafresh1
46b39c5158Smillert{
47b8851fccSafresh1my $names = join "|", sort ascii_order values %$where2name;
48*3d61058aSafresh1is $names, "Zonk::Pronk|perlzuk|zikzik";
49b39c5158Smillert}
50