1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
|
|
3 |
use strict; |
use strict; |
4 |
use Test::More tests => 17; |
use Test::More tests => 18; |
5 |
use Test::Exception; |
use Test::Exception; |
6 |
use blib; |
use blib; |
7 |
|
|
11 |
use_ok( 'WebPAC::Lookup' ); |
use_ok( 'WebPAC::Lookup' ); |
12 |
} |
} |
13 |
|
|
14 |
|
my $debug = shift @ARGV; |
15 |
|
|
16 |
throws_ok { new WebPAC::Lookup( no_log => 1 ) } qr/lookup_file/, "new without lookup_file"; |
throws_ok { new WebPAC::Lookup( no_log => 1 ) } qr/lookup_file/, "new without lookup_file"; |
17 |
|
|
18 |
ok(my $lookup = new WebPAC::Lookup( |
ok(my $lookup = new WebPAC::Lookup( |
35 |
|
|
36 |
ok($lookup->add( $rec ), "add"); |
ok($lookup->add( $rec ), "add"); |
37 |
|
|
38 |
ok($lookup->{'_lookup_data'}, "{_lookup_data}"); |
ok(my $l1 = $lookup->{_lookup_data}, "{_lookup_data}"); |
39 |
ok($lookup->lookup_hash, "lookup_hash"); |
diag "lookup->{_lookup_data} = ",Dumper($lookup->{_lookup_data}) if ($debug); |
40 |
|
ok(my $l2 = $lookup->lookup_hash, "lookup_hash"); |
41 |
|
diag "lookup->lookup_hash = ",Dumper($lookup->lookup_hash) if ($debug); |
42 |
|
|
43 |
|
is_deeply( $l1, $l2, 'lookups same'); |
44 |
|
|
45 |
my $lookup_res = { |
my $lookup_res = { |
46 |
'800:foo' => [ 'bar' ], |
'800:foo' => [ 'bar' ], |