Parent Directory | Revision Log
search work (Content-type and attributes fix), NodeResult->doc_num now return proper number of hits (and not index of last one which isi doc_num - 1)
1 | #!/usr/bin/perl -w |
2 | |
3 | use strict; |
4 | use blib; |
5 | |
6 | use Test::More tests => 10; |
7 | use Test::Exception; |
8 | use Data::Dumper; |
9 | |
10 | BEGIN { use_ok('Search::Estraier') }; |
11 | |
12 | my $data = { |
13 | docs => [ qw/1 2 3 4 5/ ], |
14 | hints => { |
15 | VERSION => 0.42, |
16 | NODE => 'none', |
17 | HIT => 42, |
18 | DOCNUM => 1234, |
19 | WORDNUM => 4321, |
20 | }, |
21 | }; |
22 | |
23 | dies_ok { new Search::Estraier::NodeResult } "new without args"; |
24 | ok(my $res = new Search::Estraier::NodeResult( %$data ), 'new'); |
25 | isa_ok($res, 'Search::Estraier::NodeResult'); |
26 | |
27 | cmp_ok($res->doc_num, '==', $#{$data->{docs}} + 1, 'doc_num'); |
28 | |
29 | for (my $i = 0; $i < $res->doc_num; $i++) { |
30 | ok(my $doc = $res->get_doc($i), "get_doc $i"); |
31 | } |
Name | Value |
---|---|
svn:executable | * |
ViewVC Help | |
Powered by ViewVC 1.1.26 |