X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=Equinox-Migration%2Ft%2F02-SubfieldMapper.t;h=c948fdd5afcc2d33a184712049b2b8cc473b8c72;hp=058f3c23188e11fb8f7dbf55142a30e4b9239773;hb=2e53c25a974483f4d2519682d38455401cbde08e;hpb=f31b41545e735198c20f969107794b8e024ecfda diff --git a/Equinox-Migration/t/02-SubfieldMapper.t b/Equinox-Migration/t/02-SubfieldMapper.t index 058f3c2..c948fdd 100644 --- a/Equinox-Migration/t/02-SubfieldMapper.t +++ b/Equinox-Migration/t/02-SubfieldMapper.t @@ -1,6 +1,6 @@ #!perl -T -use Test::More tests => 40; +use Test::More tests => 41; #use Test::More qw(no_plan); use Equinox::Migration::SubfieldMapper; @@ -90,10 +90,11 @@ is ($sm->field(650,'z'), undef, 'tag+code not mapped'); is ($sm->field(949,'a'), 'call_number', 'mapping returned'); # mod method tests -is ($sm->{fields}{note}{mods}[0], 'multi'); +is ($sm->{fields}{note}{mods}{multi}, 1); is ($sm->mods('zzz'), undef, 'nonexistant field'); -is_deeply ($sm->mods('note'), ['multi'], 'multi'); -is_deeply ($sm->mods('note_alt'), ['multi', 'req'], 'multi, req'); -is_deeply ($sm->mods('date_a'), ['foo', 'bar', 'quux']); -is_deeply ($sm->filters('date_a'), ['baz']); +is_deeply ($sm->mods('note'), { multi => 1}, 'multi'); +is_deeply ($sm->mods('note_alt'), { multi => 1, req => 1 }, 'multi, req'); +is_deeply ($sm->mods('date_a'), { foo => 1, bar => 1, quux => 1 }); +is_deeply ($sm->filters('date_a'), ['one two three']); +is_deeply ($sm->filters('type'), ['foo']);