r616@llin: dpavlin | 2006-05-13 15:40:49 +0200
[webpac2] / t / 1-lookup.t
index 89aaff8..c37b87a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use Test::More tests => 17;
+use Test::More tests => 18;
 use Test::Exception;
 use blib;
 
@@ -11,6 +11,8 @@ BEGIN {
 use_ok( 'WebPAC::Lookup' );
 }
 
+my $debug = shift @ARGV;
+
 throws_ok { new WebPAC::Lookup( no_log => 1 ) } qr/lookup_file/, "new without lookup_file";
 
 ok(my $lookup = new WebPAC::Lookup(
@@ -33,8 +35,12 @@ diag "testing WebPAC::Lookup own methods";
 
 ok($lookup->add( $rec ), "add");
 
-ok($lookup->{'_lookup_data'}, "{_lookup_data}");
-ok($lookup->lookup_hash, "lookup_hash");
+ok(my $l1 = $lookup->{_lookup_data}, "{_lookup_data}");
+diag "lookup->{_lookup_data} = ",Dumper($lookup->{_lookup_data}) if ($debug);
+ok(my $l2 = $lookup->lookup_hash, "lookup_hash");
+diag "lookup->lookup_hash = ",Dumper($lookup->lookup_hash) if ($debug);
+
+is_deeply( $l1, $l2, 'lookups same');
 
 my $lookup_res = { 
        '800:foo' => [ 'bar' ],