2 |
|
|
3 |
use strict; |
use strict; |
4 |
|
|
5 |
use Test::More tests => 8; |
use Test::More tests => 11; |
6 |
use Test::Exception; |
use Test::Exception; |
7 |
use blib; |
use blib; |
8 |
|
|
19 |
|
|
20 |
$i = SWISH::PlusPlus->open( |
$i = SWISH::PlusPlus->open( |
21 |
index_dir => $index, |
index_dir => $index, |
22 |
|
debug => 0, |
23 |
); |
); |
24 |
ok($i, "open index"); |
ok($i, "open index"); |
25 |
|
|
36 |
ok($i->index_document( _dummy_ => '' ), "fillter"); |
ok($i->index_document( _dummy_ => '' ), "fillter"); |
37 |
|
|
38 |
cmp_ok($i->{'index_dir'}, 'eq', $index, "index_dir ok"); |
cmp_ok($i->{'index_dir'}, 'eq', $index, "index_dir ok"); |
39 |
|
|
40 |
|
foreach my $word (qw(meaning of life)) { |
41 |
|
my @r = $i->search($word); |
42 |
|
cmp_ok(scalar @r, '==', 1, "find $word"); |
43 |
|
} |