1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
use strict;
use warnings;
use Test::More;
# preamble to make it work portably regardless of where the test is run
use File::Spec::Functions;
my ($volume, $dirstring, $file) = File::Spec->splitpath($0);
my @DIRS = File::Spec->splitdir($dirstring);
pop @DIRS while (@DIRS and $DIRS[-1] =~ /^(t|)$/);
unshift @INC, catdir(@DIRS);
#plan 'no_plan';
plan tests => 4;
use_ok('Pod::Index::Search');
my $q = Pod::Index::Search->new(
filename => catfile(@DIRS, 't', 'test.txt'),
);
isa_ok($q, 'Pod::Index::Search');
my @subtopics = $q->subtopics('balloon');
is_deeply(
\@subtopics,
['balloon, floating', 'balloon, gas-filled', 'balloon, light'],
'topics'
);
@subtopics = $q->subtopics('balloon', deep => 1);
is_deeply(
\@subtopics,
['balloon, floating', 'balloon, gas-filled, helium', 'balloon, light'],
'topics'
);
|