3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 115; |
use Test::More tests => 118; |
7 |
use Test::Exception; |
use Test::Exception; |
8 |
use Data::Dumper; |
use Data::Dumper; |
9 |
|
|
10 |
BEGIN { use_ok('Search::Estraier') }; |
BEGIN { use_ok('Search::Estraier') }; |
11 |
|
|
12 |
my $debug = 0; |
my $debug = 1; |
13 |
|
|
14 |
# name of node for test |
# name of node for test |
15 |
my $test1_node = 'test1'; |
my $test1_node = 'test1'; |
30 |
|
|
31 |
cmp_ok($node->status, '==', -1, 'status'); |
cmp_ok($node->status, '==', -1, 'status'); |
32 |
|
|
33 |
|
# test master functionality |
34 |
|
|
35 |
|
ok($node->master( action => 'sync' ), 'sync'); |
36 |
|
|
37 |
|
|
38 |
SKIP: { |
SKIP: { |
39 |
|
|
40 |
skip "no $test1_node node in Hyper Estraier", 96, unless($node->name); |
skip "no $test1_node node in Hyper Estraier", 108, unless($node->name); |
41 |
|
|
42 |
my @res = ( -1, 200 ); |
my @res = ( -1, 200 ); |
43 |
|
|
161 |
ok(! $node->admins, 'no admins'); |
ok(! $node->admins, 'no admins'); |
162 |
ok(! $node->guests, 'no guests'); |
ok(! $node->guests, 'no guests'); |
163 |
|
|
164 |
|
# test search without results |
165 |
|
|
166 |
|
ok($cond = new Search::Estraier::Condition, 'new cond'); |
167 |
|
ok($cond->set_phrase('this_is_phrase_which_does_not_exits'), 'cond set_phrase'); |
168 |
|
|
169 |
|
ok($nres = $node->search( $cond, 0 ), 'search'); |
170 |
|
|
171 |
SKIP: { |
SKIP: { |
172 |
skip "no $test2_node in Hyper Estraier, skipping set_link", 5 unless (my $test2_label = $node2->label); |
skip "no $test2_node in Hyper Estraier, skipping set_link", 5 unless (my $test2_label = $node2->label); |
173 |
|
|