/[webpac2]/trunk/t/1-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/1-lookup.t

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

revision 12 by dpavlin, Sat Jul 16 22:57:26 2005 UTC revision 31 by dpavlin, Sun Jul 24 15:03:11 2005 UTC
# Line 11  BEGIN { Line 11  BEGIN {
11  use_ok( 'WebPAC::Lookup' );  use_ok( 'WebPAC::Lookup' );
12  }  }
13    
14  throws_ok { new WebPAC::Lookup() } qr/lookup_file/, "new without lookup_file";  throws_ok { new WebPAC::Lookup( no_log => 1 ) } qr/lookup_file/, "new without lookup_file";
15    
16  ok(my $lookup = new WebPAC::Lookup(  ok(my $lookup = new WebPAC::Lookup(
17          lookup_file => 'conf/lookup/example.pm',          lookup_file => 'conf/lookup/example.pm',
# Line 33  diag "testing WebPAC::Lookup own methods Line 33  diag "testing WebPAC::Lookup own methods
33    
34  ok($lookup->add( $rec ), "add");  ok($lookup->add( $rec ), "add");
35    
36  ok($lookup->{'lookup'}, "have lookup hash");  ok($lookup->{'_lookup_data'}, "have lookup hash");
37    
38  my $lookup_res = {  my $lookup_res = {
39          '800:foo' => [ 'bar' ],          '800:foo' => [ 'bar' ],
# Line 41  my $lookup_res = { Line 41  my $lookup_res = {
41          '900:bar' => [ 'FOO', 'foo' ]          '900:bar' => [ 'FOO', 'foo' ]
42  };  };
43    
44  is_deeply($lookup_res, $lookup->{'lookup'}, "lookup data");  is_deeply($lookup_res, $lookup->{'_lookup_data'}, "lookup data");
45    
46  foreach my $k (keys %{ $lookup_res }) {  foreach my $k (keys %{ $lookup_res }) {
47          ok(my @l = $lookup->lookup("lookup{$k}"), "lookup{$k}");          ok(my @l = $lookup->lookup("lookup{$k}"), "lookup{$k}");

Legend:
Removed from v.12  
changed lines
  Added in v.31

  ViewVC Help
Powered by ViewVC 1.1.26