use Data::Dumper;
use Test::More tests => 110;
+use File::Spec;
-BEGIN { use_ok( 'IsisDB' ); }
+BEGIN { use_ok( 'Biblio::Isis' ); }
+my $debug = shift @ARGV;
my $isis;
+my $path_winisis = File::Spec->catfile('data', 'winisis', 'BIBL');
+my $path_isismarc = File::Spec->catfile('data', 'isismarc', 'BIBL');
+
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
'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");
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");
}
}
-$isis = IsisDB->new (
- isisdb => './data/winisis/BIBL',
+$isis = Biblio::Isis->new (
+ isisdb => $path_winisis,
include_deleted => 1,
+ debug => $debug,
);
print Dumper($isis);
) ],
);
-$isis = IsisDB->new (
- isisdb => './data/isismarc/BIBL',
+$isis = Biblio::Isis->new (
+ isisdb => $path_isismarc,
include_deleted => 1,
);
# check logically deleted
-$isis = IsisDB->new (
- isisdb => './data/winisis/BIBL',
+$isis = Biblio::Isis->new (
+ isisdb => $path_winisis,
include_deleted => 1,
);
ok($isis->fetch(3), "deleted found");
cmp_ok($isis->{deleted}, '==', 3, "MFN 3 is deleted");
-$isis = IsisDB->new (
- isisdb => './data/winisis/BIBL',
+$isis = Biblio::Isis->new (
+ isisdb => $path_winisis,
+ debug => $debug,
);
ok(! $isis->fetch(3), "deleted not found");