3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 101; |
use Test::More tests => 106; |
7 |
use Test::Exception; |
use Test::Exception; |
8 |
use Data::Dumper; |
use Data::Dumper; |
9 |
|
|
32 |
|
|
33 |
SKIP: { |
SKIP: { |
34 |
|
|
35 |
skip "no $test1_node node in Hyper Estraier", 91, unless($node->name); |
skip "no $test1_node node in Hyper Estraier", 97, unless($node->name); |
36 |
|
|
37 |
my @res = ( -1, 200 ); |
my @res = ( -1, 200 ); |
38 |
|
|
143 |
|
|
144 |
ok(! $node->uri_to_id('foobar'), 'uri_to_id without croak'); |
ok(! $node->uri_to_id('foobar'), 'uri_to_id without croak'); |
145 |
|
|
146 |
|
# test users |
147 |
|
|
148 |
|
ok(! $node->admins, 'no admins'); |
149 |
|
ok(! $node->guests, 'no guests'); |
150 |
|
|
151 |
SKIP: { |
SKIP: { |
152 |
skip "no $test2_node in Hyper Estraier, skipping set_link", 2 unless (my $test2_label = $node2->label); |
skip "no $test2_node in Hyper Estraier, skipping set_link", 2 unless (my $test2_label = $node2->label); |
153 |
|
|
154 |
ok($node->set_link("http://localhost:1978/node/$test2_node", $test2_label, 42), "set_link $test2_node ($test2_label) 42"); |
my $link_url = "http://localhost:1978/node/$test2_node"; |
155 |
|
|
156 |
|
ok($node->set_link( $link_url, $test2_label, 42), "set_link $test2_node ($test2_label) 42"); |
157 |
|
|
158 |
|
ok(my $links = $node->links, 'links'); |
159 |
|
|
160 |
|
cmp_ok($#{$links}, '==', 0, 'one link'); |
161 |
|
|
162 |
|
like($links->[0], qr/^$link_url/, 'link correct'); |
163 |
|
|
164 |
ok($node->set_link("http://localhost:1978/node/$test2_node", $test2_label, 0), "set_link $test2_node ($test2_label) delete"); |
ok($node->set_link("http://localhost:1978/node/$test2_node", $test2_label, 0), "set_link $test2_node ($test2_label) delete"); |
165 |
} # SKIP 2 |
} # SKIP 2 |
166 |
|
|