/[Search-Estraier]/trunk/t/4_NodeResult.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/t/4_NodeResult.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 53 - (show annotations)
Fri Jan 6 14:39:45 2006 UTC (18 years, 3 months ago) by dpavlin
File MIME type: application/x-troff
File size: 633 byte(s)
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 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26