--- trunk/t/1-lookup.t 2005/07/16 16:00:19 7 +++ trunk/t/1-lookup.t 2006/05/13 12:07:56 473 @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use Test::More tests => 15; +use Test::More tests => 17; use Test::Exception; use blib; @@ -11,7 +11,7 @@ use_ok( 'WebPAC::Lookup' ); } -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"; ok(my $lookup = new WebPAC::Lookup( lookup_file => 'conf/lookup/example.pm', @@ -20,6 +20,9 @@ }, ), "new"); +ok(my $regex = $lookup->regex, "regex"); +diag "regex: $regex"; + my $rec = { '000' => [ '001' ], '800' => [ 'foo' ], @@ -30,7 +33,8 @@ ok($lookup->add( $rec ), "add"); -ok($lookup->{'lookup'}, "have lookup hash"); +ok($lookup->{'_lookup_data'}, "{_lookup_data}"); +ok($lookup->lookup_hash, "lookup_hash"); my $lookup_res = { '800:foo' => [ 'bar' ], @@ -38,7 +42,7 @@ '900:bar' => [ 'FOO', 'foo' ] }; -is_deeply($lookup_res, $lookup->{'lookup'}, "lookup data"); +is_deeply($lookup_res, $lookup->{'_lookup_data'}, "lookup data"); foreach my $k (keys %{ $lookup_res }) { ok(my @l = $lookup->lookup("lookup{$k}"), "lookup{$k}");