Debian Codegraph @

t/Catmandu/Fix/marc_append.t

raw
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
10 my $pkg;
11
12 BEGIN {
13 $pkg = 'Catmandu::Fix::marc_append';
14 use_ok $pkg;
15 }
16
17 require_ok $pkg;
18
19 my $fixer = Catmandu::Fix->new(fixes => [q|marc_append('100','.')|,q|marc_map('100','test')|]);
20 my $importer = Catmandu::Importer::MARC->new( file => 't/camel.mrc', type => "ISO" );
21 my $record = $fixer->fix($importer->first);
22
23 like $record->{test}, qr/^Martinsson, Tobias,1976-\.$/, q|fix: marc_append('100','.')|;
24
25 done_testing;