~ubuntu-branches/ubuntu/gutsy/horae/gutsy

« back to all changes in this revision

Viewing changes to 0CPAN/Pod-Simple-3.03/t/search_28_glob_z_kleene_k.t

  • Committer: Bazaar Package Importer
  • Author(s): Carlo Segre
  • Date: 2006-12-28 12:36:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061228123648-9xnjr76wfthd92cq
Tags: 064-1
New upstream release, dropped dependency on libtk-filedialog-perl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
use strict;
3
 
use Pod::Simple::Search;
4
 
use Test;
5
 
BEGIN { plan tests => 4 }
6
 
 
7
 
print "# ", __FILE__,
8
 
 ": Testing limit_glob ...\n";
9
 
 
10
 
my $x = Pod::Simple::Search->new;
11
 
die "Couldn't make an object!?" unless ok defined $x;
12
 
 
13
 
$x->inc(0);
14
 
$x->shadows(1);
15
 
 
16
 
use File::Spec;
17
 
use Cwd;
18
 
my $cwd = cwd();
19
 
print "# CWD: $cwd\n";
20
 
 
21
 
my($here1, $here2, $here3);
22
 
 
23
 
if(        -e ($here1 = File::Spec->catdir($cwd,      'test^lib'      ))) {
24
 
  die "But where's $here2?"
25
 
    unless -e ($here2 = File::Spec->catdir($cwd,      'other^test^lib'));
26
 
  die "But where's $here3?"
27
 
    unless -e ($here3 = File::Spec->catdir($cwd,      'yet^another^test^lib'));
28
 
 
29
 
} elsif(   -e ($here1 = File::Spec->catdir($cwd, 't', 'test^lib'      ))) {
30
 
  die "But where's $here2?"
31
 
    unless -e ($here2 = File::Spec->catdir($cwd, 't', 'other^test^lib'));
32
 
  die "But where's $here3?"
33
 
    unless -e ($here3 = File::Spec->catdir($cwd, 't', 'yet^another^test^lib'));
34
 
 
35
 
} else {
36
 
  die "Can't find the test corpora";
37
 
}
38
 
print "# OK, found the test corpora\n#  as $here1\n# and $here2\n# and $here3\n#\n";
39
 
ok 1;
40
 
 
41
 
print $x->_state_as_string;
42
 
#$x->verbose(12);
43
 
 
44
 
use Pod::Simple;
45
 
*pretty = \&Pod::Simple::BlackBox::pretty;
46
 
 
47
 
my $glob = '*z*k*';
48
 
print "# Limiting to $glob\n";
49
 
$x->limit_glob($glob);
50
 
 
51
 
my($name2where, $where2name) = $x->survey($here1, $here2, $here3);
52
 
 
53
 
my $p = pretty( $where2name, $name2where )."\n";
54
 
$p =~ s/, +/,\n/g;
55
 
$p =~ s/^/#  /mg;
56
 
print $p;
57
 
 
58
 
{
59
 
my $names = join "|", sort values %$where2name;
60
 
ok $names, "Zonk::Pronk|perlzuk|zikzik";
61
 
}
62
 
 
63
 
 
64
 
print "# OK, bye from ", __FILE__, "\n";
65
 
ok 1;
66
 
 
67
 
__END__
68