Skip to content

Commit

Permalink
add test for option pluck on multiple fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jorol committed Apr 20, 2020
1 parent 7783a98 commit dee0049
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion t/Catmandu-Fix-pica_map.t
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,23 @@ note('Check for empty return values');
ok( !exists $record->{array} );
}

done_testing();
note('Repeated field split pluck');

{
my $fixer = Catmandu::Fix->new(
fixes => [
'pica_map(099Aba, pluck, split:1, pluck:1)',
'remove_field(record)'
]
);
my $record = $fixer->fix(
{ record => [
[ '099A', '', 'a', 'A', 'b', 'B' ],
[ '099A', '', 'b', 'B', 'a', 'A' ]
]
}
);
is_deeply( $record->{pluck}, [ 'B', 'A', 'B', 'A' ] )
}

done_testing();

0 comments on commit dee0049

Please sign in to comment.