3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 97; |
use Test::More tests => 98; |
7 |
use Test::Exception; |
use Test::Exception; |
8 |
use Data::Dumper; |
use Data::Dumper; |
9 |
|
|
90 |
|
|
91 |
cmp_ok($node->cond_to_query( $cond ), 'eq' , 'phrase=girl&attr1=%40title%20STRINC%20Material&order=%40uri%20ASCD&max='.$max.'&wwidth=480&hwidth=96&awidth=96', 'cond_to_query'); |
cmp_ok($node->cond_to_query( $cond ), 'eq' , 'phrase=girl&attr1=%40title%20STRINC%20Material&order=%40uri%20ASCD&max='.$max.'&wwidth=480&hwidth=96&awidth=96', 'cond_to_query'); |
92 |
|
|
93 |
ok( my $nrec = $node->search( $cond, 0 ), 'search'); |
ok( my $nres = $node->search( $cond, 0 ), 'search'); |
94 |
|
|
95 |
isa_ok( $nrec, 'Search::Estraier::NodeResult' ); |
isa_ok( $nres, 'Search::Estraier::NodeResult' ); |
96 |
|
|
97 |
cmp_ok($nrec->doc_num, '==', $max, "doc_num = $max"); |
cmp_ok($nres->doc_num, '==', $max, "doc_num = $max"); |
98 |
|
|
99 |
for ( 6 .. 10 ) { |
for ( 6 .. 10 ) { |
100 |
my $uri = 'test' . $_; |
my $uri = 'test' . $_; |
109 |
ok( eq_hash( $k, $k2 ), "keywords"); |
ok( eq_hash( $k, $k2 ), "keywords"); |
110 |
} |
} |
111 |
|
|
112 |
|
ok(my $hints = $nres->hints, 'hints'); |
113 |
|
diag Dumper($hints); |
114 |
|
|
115 |
ok($node->_set_info, "refresh _set_info"); |
ok($node->_set_info, "refresh _set_info"); |
116 |
|
|
117 |
my $v; |
my $v; |
132 |
# croak_on_error |
# croak_on_error |
133 |
|
|
134 |
ok(my $node2 = new Search::Estraier::Node( url => "http://localhost:1978/non-existant", croak_on_error => 1 ), "new non-existant"); |
ok(my $node2 = new Search::Estraier::Node( url => "http://localhost:1978/non-existant", croak_on_error => 1 ), "new non-existant"); |
135 |
throws_ok { $node->name } qr/port/, 'croak on error'; |
throws_ok { $node2->name } qr/404/, 'croak on error'; |
136 |
|
|
137 |
SKIP: { |
SKIP: { |
138 |
skip "no $test2_node in Hyper Estraier, skipping set_link", 2 unless (my $test1_label = $node1->label); |
skip "no $test2_node in Hyper Estraier, skipping set_link", 2 unless (my $test1_label = $node1->label); |