Bugzilla – Attachment 165929 Details for
Bug 36515
Amend MARC modification templates so control fields can be copied to subfields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36515: Add unit tests
Bug-36515-Add-unit-tests.patch (text/plain), 1.76 KB, created by
Alex Buckley
on 2024-04-30 19:09:14 UTC
(
hide
)
Description:
Bug 36515: Add unit tests
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2024-04-30 19:09:14 UTC
Size:
1.76 KB
patch
obsolete
>From c6b1b5f80c7dc0490de949ef17acd124676da22d Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Tue, 30 Apr 2024 18:59:24 +0000 >Subject: [PATCH] Bug 36515: Add unit tests > >Test plan: >1. Run unit tests >ktd --shell >prove t/SimpleMARC.t > >Sponsored-by: Education Services Australia SCIS >--- > t/SimpleMARC.t | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > >diff --git a/t/SimpleMARC.t b/t/SimpleMARC.t >index 3e8e840ff84..da6b98ff7f0 100755 >--- a/t/SimpleMARC.t >+++ b/t/SimpleMARC.t >@@ -924,7 +924,7 @@ subtest 'copy_field' => sub { > > # copy_and_replace_field - subfield > subtest 'copy_and_replace_field' => sub { >- plan tests => 2; >+ plan tests => 3; > subtest 'copy and replace subfield' => sub { > plan tests => 20; > my $record = new_record; >@@ -1516,6 +1516,28 @@ subtest 'copy_and_replace_field' => sub { > 'Copy and replace to an existent field should not create a new field' > ); > }; >+ >+ # Copy and replace with control field >+ subtest 'copy and replace control field' => sub { >+ plan tests => 1; >+ my $record = new_record; >+ $record->append_fields( >+ MARC::Field->new( '001', '4815162342' ), >+ ); >+ >+ # Copy control field to subfield >+ copy_and_replace_field( >+ { record => $record, from_field => '001', to_field => '099', to_subfield => 'a' } ); >+ is_deeply( >+ [ >+ read_field( >+ { record => $record, field => '099', subfield => 'a' } >+ ) >+ ], >+ ['4815162342'], >+ 'Copy and replace - Update a subfield with content of control field' >+ ); >+ }; > }; > > # move_field - subfields >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36515
:
164575
|
165924
|
165928
|
165929
|
166026
|
166027
|
169215
|
169216