| 1 |
#!perl |
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
use Test::More; |
| 6 |
use Test::Exception; |
| 7 |
use Catmandu::Importer::MARC; |
| 8 |
use Catmandu::Fix; |
| 9 |
use utf8; |
| 10 |
|
| 11 |
my $pkg; |
| 12 |
|
| 13 |
BEGIN { |
| 14 |
$pkg = 'Catmandu::Fix::marc_decode_dollar_subfields'; |
| 15 |
use_ok $pkg; |
| 16 |
} |
| 17 |
|
| 18 |
require_ok $pkg; |
| 19 |
|
| 20 |
my $fixer = Catmandu::Fix->new(fixes => [ |
| 21 |
q|marc_decode_dollar_subfields()|, |
| 22 |
q|marc_map('200e','test')| |
| 23 |
]); |
| 24 |
|
| 25 |
# t/dollar_subfields.mrc a special prepared marc file containing $subfields als values |
| 26 |
my $importer = Catmandu::Importer::MARC->new( file => 't/dollar_subfields.mrc', type => "RAW" ); |
| 27 |
my $record = $fixer->fix($importer->first); |
| 28 |
|
| 29 |
like $record->{test}, qr/: Ermoupolis, Syros Island, Greece/, q|fix: marc_decode_dollar_subfields()|; |
| 30 |
|
| 31 |
done_testing; |