2 |
|
|
3 |
use strict; |
use strict; |
4 |
|
|
5 |
use Test::More tests => 16; |
use Test::More tests => 6; |
6 |
use Test::Exception; |
use Test::Exception; |
7 |
use Cwd qw/abs_path/; |
use Cwd qw/abs_path/; |
8 |
use File::Temp qw/tempdir/; |
use File::Temp qw/tempdir/; |
26 |
), "new"); |
), "new"); |
27 |
|
|
28 |
my $query = 'ivan'; |
my $query = 'ivan'; |
29 |
my $max = 3; |
my $max = 10; |
30 |
|
|
31 |
ok(my @res = $est->search( |
ok(my @res = $est->search( |
32 |
query => $query, |
query => $query, |
33 |
max => $max, |
max => $max, |
34 |
attr => [ qw/PersonalName/ ], |
attr => [ qw/PersonalName TitleProper/ ], |
35 |
), "search $query, max: $max"); |
), "search $query, max: $max"); |
36 |
|
|
37 |
cmp_ok($#res, '==', $max, "$max hits"); |
cmp_ok(($#res + 1), '==', $max, "$max hits"); |
38 |
|
|
39 |
diag Dumper(\@res); |
diag Dumper(\@res); |
40 |
|
|