1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
|
|
3 |
use strict; |
use strict; |
4 |
use Test::More tests => 6; |
use Test::More tests => 15; |
5 |
use Test::Exception; |
use Test::Exception; |
6 |
use blib; |
use blib; |
7 |
|
|
26 |
'900' => [ 'bar' ], |
'900' => [ 'bar' ], |
27 |
}; |
}; |
28 |
|
|
29 |
ok($lookup->add( $rec ), "add"); |
diag "testing WebPAC::Lookup own methods"; |
30 |
|
|
31 |
print Dumper($lookup); |
ok($lookup->add( $rec ), "add"); |
32 |
|
|
33 |
ok($lookup->{'lookup'}, "have lookup hash"); |
ok($lookup->{'lookup'}, "have lookup hash"); |
34 |
|
|
40 |
|
|
41 |
is_deeply($lookup_res, $lookup->{'lookup'}, "lookup data"); |
is_deeply($lookup_res, $lookup->{'lookup'}, "lookup data"); |
42 |
|
|
43 |
|
foreach my $k (keys %{ $lookup_res }) { |
44 |
|
ok(my @l = $lookup->lookup("lookup{$k}"), "lookup{$k}"); |
45 |
|
|
46 |
|
cmp_ok($#l, '==', $#{$lookup_res->{$k}}, "result size"); |
47 |
|
|
48 |
|
is_deeply($lookup_res->{$k}, \@l, "result values"); |
49 |
|
} |
50 |
|
|
51 |
|
diag "testing WebPAC::Lookup inherited methods"; |