5 |
|
|
6 |
use Data::Dumper; |
use Data::Dumper; |
7 |
|
|
8 |
use Test::More tests => 104; |
use Test::More tests => 108; |
9 |
|
|
10 |
BEGIN { use_ok( 'IsisDB' ); } |
BEGIN { use_ok( 'IsisDB' ); } |
11 |
|
|
98 |
my $i = 0; |
my $i = 0; |
99 |
foreach my $v (@{$data->[$mfn-1]->{$f}}) { |
foreach my $v (@{$data->[$mfn-1]->{$f}}) { |
100 |
$v =~ s/^[01# ][01# ]// if ($args->{no_ident}); |
$v =~ s/^[01# ][01# ]// if ($args->{no_ident}); |
101 |
cmp_ok($rec->{$f}->[$i], '==', $v, "MFN $mfn $f:$i $v"); |
cmp_ok($v, '==', $rec->{$f}->[$i], "MFN $mfn $f:$i $v"); |
102 |
$i++; |
$i++; |
103 |
} |
} |
104 |
} |
} |
113 |
|
|
114 |
foreach my $mfn (1 .. $isis->{'maxmfn'}) { |
foreach my $mfn (1 .. $isis->{'maxmfn'}) { |
115 |
my $md5 = md5_hex($isis->to_ascii($mfn)); |
my $md5 = md5_hex($isis->to_ascii($mfn)); |
116 |
cmp_ok($args->{md5_ascii}[$mfn - 1], 'eq', $md5, "md5 $mfn"); |
cmp_ok($md5, 'eq', $args->{md5_ascii}[$mfn - 1], "md5 $mfn"); |
117 |
} |
} |
118 |
} |
} |
119 |
|
|
121 |
|
|
122 |
$isis = IsisDB->new ( |
$isis = IsisDB->new ( |
123 |
isisdb => './data/winisis/BIBL', |
isisdb => './data/winisis/BIBL', |
124 |
|
include_deleted => 1, |
125 |
); |
); |
126 |
|
|
127 |
print Dumper($isis); |
print Dumper($isis); |
131 |
md5_ascii => [ qw( |
md5_ascii => [ qw( |
132 |
a369eff702307ba12eb81656ee0587fe |
a369eff702307ba12eb81656ee0587fe |
133 |
4fb38537a94f3f5954e40d9536b942b0 |
4fb38537a94f3f5954e40d9536b942b0 |
134 |
498cc16c9e7ab0fdc29182533cc35d11 |
579a7c6901c654bdeac10547a98e5b71 |
135 |
7d2adf1675c83283aa9b82bf343e3d85 |
7d2adf1675c83283aa9b82bf343e3d85 |
136 |
daf2cf86ca7e188e8360a185f3b43423 |
daf2cf86ca7e188e8360a185f3b43423 |
137 |
) ], |
) ], |
139 |
|
|
140 |
$isis = IsisDB->new ( |
$isis = IsisDB->new ( |
141 |
isisdb => './data/isismarc/BIBL', |
isisdb => './data/isismarc/BIBL', |
142 |
|
include_deleted => 1, |
143 |
); |
); |
144 |
|
|
145 |
test_data( |
test_data( |
151 |
843b9ebccf16a498fba623c78f21b6c0 |
843b9ebccf16a498fba623c78f21b6c0 |
152 |
) ], |
) ], |
153 |
); |
); |
154 |
|
|
155 |
|
# check logically deleted |
156 |
|
|
157 |
|
$isis = IsisDB->new ( |
158 |
|
isisdb => './data/winisis/BIBL', |
159 |
|
include_deleted => 1, |
160 |
|
); |
161 |
|
|
162 |
|
ok($isis->fetch(3), "deleted found"); |
163 |
|
cmp_ok($isis->{deleted}, '==', 3, "MFN 3 is deleted"); |
164 |
|
|
165 |
|
$isis = IsisDB->new ( |
166 |
|
isisdb => './data/winisis/BIBL', |
167 |
|
); |
168 |
|
|
169 |
|
ok(! $isis->fetch(3), "deleted not found"); |
170 |
|
cmp_ok($isis->{deleted}, '==', 3, "MFN 3 is deleted"); |
171 |
|
|