/[webpac2]/trunk/t/01-lookup.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/01-lookup.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dpavlin, Sat Jul 16 12:37:18 2005 UTC revision 5 by dpavlin, Sat Jul 16 12:40:28 2005 UTC
# Line 13  use_ok( 'WebPAC::Lookup' ); Line 13  use_ok( 'WebPAC::Lookup' );
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' ],
# Line 30  ok($lookup->{'lookup'}, "have lookup has Line 35  ok($lookup->{'lookup'}, "have lookup has
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");

Legend:
Removed from v.4  
changed lines
  Added in v.5

  ViewVC Help
Powered by ViewVC 1.1.26