13 |
|
|
14 |
throws_ok { new WebPAC::Lookup() } qr/lookup_file/, "new without lookup_file"; |
throws_ok { new WebPAC::Lookup() } qr/lookup_file/, "new without lookup_file"; |
15 |
|
|
16 |
ok(my $lookup = new WebPAC::Lookup( lookup_file => 'conf/lookup/example.pm' ), "new"); |
ok(my $lookup = new WebPAC::Lookup( |
17 |
|
lookup_file => 'conf/lookup/example.pm', |
18 |
|
filter => { |
19 |
|
'upper' => sub { return uc(shift); }, |
20 |
|
}, |
21 |
|
), "new"); |
22 |
|
|
23 |
my $rec = { |
my $rec = { |
24 |
'000' => [ '001' ], |
'000' => [ '001' ], |
35 |
my $lookup_res = { |
my $lookup_res = { |
36 |
'800:foo' => [ 'bar' ], |
'800:foo' => [ 'bar' ], |
37 |
'000:001' => [ '001' ], |
'000:001' => [ '001' ], |
38 |
'900:bar' => [ 'foo', 'foo' ] |
'900:bar' => [ 'FOO', 'foo' ] |
39 |
}; |
}; |
40 |
|
|
41 |
is_deeply($lookup_res, $lookup->{'lookup'}, "lookup data"); |
is_deeply($lookup_res, $lookup->{'lookup'}, "lookup data"); |