3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 176; |
use Test::More tests => 181; |
7 |
use File::Spec; |
use File::Spec; |
8 |
|
|
9 |
BEGIN { |
BEGIN { |
271 |
diag "to_hash = ",Dumper( $hash ) if ($debug); |
diag "to_hash = ",Dumper( $hash ) if ($debug); |
272 |
is_deeply( $hash, { |
is_deeply( $hash, { |
273 |
"000" => [42], |
"000" => [42], |
274 |
|
900 => [{ a => "900a", b => "900b", c => "900c" }], |
275 |
|
901 => [ |
276 |
|
{ a => "901a-1", b => "901b-1", c => "901c-1" }, |
277 |
|
{ a => "901a-2", b => "901b-2" }, |
278 |
|
{ a => "901a-3" }, |
279 |
|
], |
280 |
|
902 => [{ a => "a1 ; a2 ; a3 ; a4 ; a5", b => "b1 ; b2", c => "c1" }], |
281 |
|
}, 'hash is_deeply'); |
282 |
|
|
283 |
|
my $isis2; |
284 |
|
ok($isis2 = Biblio::Isis->new ( |
285 |
|
isisdb => $path_winisis, |
286 |
|
join_subfields_with => ' ; ', |
287 |
|
),"new( join_subfields_with )"); |
288 |
|
ok($isis2->{record} = $isis->{record}, "copy record"); |
289 |
|
ok($isis2->{current_mfn} = $isis->{current_mfn}, "copy current_mfn"); |
290 |
|
|
291 |
|
ok($hash = $isis2->to_hash( $isis->mfn ), 'to_hash(mfn)'); |
292 |
|
diag "to_hash = ",Dumper( $hash ) if ($debug); |
293 |
|
is_deeply( $hash, { |
294 |
|
"000" => [42], |
295 |
900 => [{ a => "900a", b => "900b", c => "900c" }], |
900 => [{ a => "900a", b => "900b", c => "900c" }], |
296 |
901 => [ |
901 => [ |
297 |
{ a => "901a-1", b => "901b-1", c => "901c-1" }, |
{ a => "901a-1", b => "901b-1", c => "901c-1" }, |