X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=t%2F002_isis.t;h=e1163e555e4621a9bd557e27c95993ce7a9de616;hb=93653871b2f53e6f93524bc5ee4f761bfd6f678f;hp=3b93a0a22626222cea0a78168d84c237d1789c8e;hpb=f58359f302818beabc46911611776b1d8a1d7e77;p=Biblio-Isis diff --git a/t/002_isis.t b/t/002_isis.t index 3b93a0a..e1163e5 100755 --- a/t/002_isis.t +++ b/t/002_isis.t @@ -7,17 +7,18 @@ use Data::Dumper; use Test::More tests => 110; -BEGIN { use_ok( 'IsisDB' ); } +BEGIN { use_ok( 'Biblio::Isis' ); } +my $debug = shift @ARGV; my $isis; sub test_data { my $args = {@_}; - isa_ok ($isis, 'IsisDB'); + isa_ok ($isis, 'Biblio::Isis'); - cmp_ok($isis->{maxmfn}, '==', 5, "maxmfn set to 5"); + cmp_ok($isis->count, '==', 5, "count is 5"); # test .CNT data @@ -92,7 +93,7 @@ sub test_data { '200' => [ '1#^aPsychology^fCamille B. Wortman, Elizabeth F. Loftus, Mary E. Marshal' ], } ]; - foreach my $mfn (1 .. $isis->{'maxmfn'}) { + foreach my $mfn (1 .. $isis->count) { my $rec; ok($rec = $isis->fetch($mfn), "fetch $mfn"); @@ -113,7 +114,7 @@ sub test_data { skip "no Digest::MD5 module", 5 if ($@); - foreach my $mfn (1 .. $isis->{'maxmfn'}) { + foreach my $mfn (1 .. $isis->count) { my $md5 = md5_hex($isis->to_ascii($mfn)); cmp_ok($md5, 'eq', $args->{md5_ascii}[$mfn - 1], "md5 $mfn"); } @@ -121,9 +122,10 @@ sub test_data { } -$isis = IsisDB->new ( +$isis = Biblio::Isis->new ( isisdb => './data/winisis/BIBL', include_deleted => 1, + debug => $debug, ); print Dumper($isis); @@ -139,7 +141,7 @@ test_data( ) ], ); -$isis = IsisDB->new ( +$isis = Biblio::Isis->new ( isisdb => './data/isismarc/BIBL', include_deleted => 1, ); @@ -156,7 +158,7 @@ test_data( # check logically deleted -$isis = IsisDB->new ( +$isis = Biblio::Isis->new ( isisdb => './data/winisis/BIBL', include_deleted => 1, ); @@ -164,8 +166,9 @@ $isis = IsisDB->new ( ok($isis->fetch(3), "deleted found"); cmp_ok($isis->{deleted}, '==', 3, "MFN 3 is deleted"); -$isis = IsisDB->new ( +$isis = Biblio::Isis->new ( isisdb => './data/winisis/BIBL', + debug => $debug, ); ok(! $isis->fetch(3), "deleted not found");