2 |
|
|
3 |
use strict; |
use strict; |
4 |
|
|
5 |
use Test::More tests => 69; |
use Test::More tests => 75; |
6 |
use Test::Exception; |
use Test::Exception; |
7 |
use Cwd qw/abs_path/; |
use Cwd qw/abs_path/; |
8 |
use blib; |
use blib; |
342 |
}, 'correct get_ds'); |
}, 'correct get_ds'); |
343 |
|
|
344 |
# MARC |
# MARC |
345 |
test_s(qq{ marc21('900','a', rec('200') ) }); |
test_s(qq{ marc_indicators('900',1,2) }); |
346 |
|
test_s(qq{ marc('900','a', rec('200') ) }); |
347 |
my @marc; |
my @marc; |
348 |
ok(@marc = WebPAC::Normalize::_get_marc21_fields(), "_get_marc21_fields"); |
ok(@marc = WebPAC::Normalize::_get_marc_fields(), "_get_marc_fields"); |
349 |
diag Dumper(\@marc); |
|
350 |
|
is_deeply( \@marc, [ |
351 |
|
[ '900', 1, 2, 'a', '200a' ], |
352 |
|
[ '900', 1, 2, 'a', '200-solo' ] |
353 |
|
], 'correct marc with indicators'); |
354 |
|
|
355 |
|
test_s(qq{ marc_indicators('900',' ',9) }); |
356 |
|
test_s(qq{ marc_repeatable_subfield('900','a', rec('200') ) }); |
357 |
|
|
358 |
|
ok(@marc = WebPAC::Normalize::_get_marc_fields(), "_get_marc_fields"); |
359 |
|
|
360 |
|
is_deeply( \@marc, [ |
361 |
|
[ '900', 1, 2, 'a', '200a', 'a', '200-solo' ], |
362 |
|
[ '900', ' ', 9, 'a', '200a', 'a', '200-solo' ] |
363 |
|
], 'correct marc with repetable subfield'); |
364 |
} |
} |
365 |
|
|