Lines 924-930
subtest 'copy_field' => sub {
Link Here
|
924 |
|
924 |
|
925 |
# copy_and_replace_field - subfield |
925 |
# copy_and_replace_field - subfield |
926 |
subtest 'copy_and_replace_field' => sub { |
926 |
subtest 'copy_and_replace_field' => sub { |
927 |
plan tests => 2; |
927 |
plan tests => 3; |
928 |
subtest 'copy and replace subfield' => sub { |
928 |
subtest 'copy and replace subfield' => sub { |
929 |
plan tests => 20; |
929 |
plan tests => 20; |
930 |
my $record = new_record; |
930 |
my $record = new_record; |
Lines 1516-1521
subtest 'copy_and_replace_field' => sub {
Link Here
|
1516 |
'Copy and replace to an existent field should not create a new field' |
1516 |
'Copy and replace to an existent field should not create a new field' |
1517 |
); |
1517 |
); |
1518 |
}; |
1518 |
}; |
|
|
1519 |
|
1520 |
# Copy and replace with control field |
1521 |
subtest 'copy and replace control field' => sub { |
1522 |
plan tests => 1; |
1523 |
my $record = new_record; |
1524 |
$record->append_fields( |
1525 |
MARC::Field->new( '001', '4815162342' ), |
1526 |
); |
1527 |
|
1528 |
# Copy control field to subfield |
1529 |
copy_and_replace_field( |
1530 |
{ record => $record, from_field => '001', to_field => '099', to_subfield => 'a' } ); |
1531 |
is_deeply( |
1532 |
[ |
1533 |
read_field( |
1534 |
{ record => $record, field => '099', subfield => 'a' } |
1535 |
) |
1536 |
], |
1537 |
['4815162342'], |
1538 |
'Copy and replace - Update a subfield with content of control field' |
1539 |
); |
1540 |
}; |
1519 |
}; |
1541 |
}; |
1520 |
|
1542 |
|
1521 |
# move_field - subfields |
1543 |
# move_field - subfields |
1522 |
- |
|
|