Bugzilla – Attachment 155717 Details for
Bug 24480
Fields added with MARC modifications templates are not added in an ordered way
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24480: (follow-up) Adjust tests
Bug-24480-follow-up-Adjust-tests.patch (text/plain), 4.24 KB, created by
Nick Clemens (kidclamp)
on 2023-09-15 20:21:26 UTC
(
hide
)
Description:
Bug 24480: (follow-up) Adjust tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-09-15 20:21:26 UTC
Size:
4.24 KB
patch
obsolete
>From b59223d281cc9f1b1b18cc43f8cc6c5ef35b4437 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 15 Sep 2023 20:06:41 +0000 >Subject: [PATCH] Bug 24480: (follow-up) Adjust tests > >With the way the patchset alters to use insert_fields_ordered, we now add fields to the beginning of their number group as opposed to appending before. We just need ot shift the order we expect the fields to end up in to make the tests pass > >To test: >1 - Apply all patches except this >2 - prove -v t/SimpleMARC.t t/db_dependent/MarcModificationTemplates.t >3 - It fails >4 - Apply this >5 - prove -v t/SimpleMARC.t t/db_dependent/MarcModificationTemplates.t >6 - It passes >--- > t/SimpleMARC.t | 6 +++--- > t/db_dependent/MarcModificationTemplates.t | 14 +++++++------- > 2 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/t/SimpleMARC.t b/t/SimpleMARC.t >index f4e4d70e43..cb53df77e5 100755 >--- a/t/SimpleMARC.t >+++ b/t/SimpleMARC.t >@@ -386,7 +386,7 @@ subtest 'copy_field' => sub { > read_field( { record => $record, field => '651', subfield => 'a' } ); > is_deeply( > \@fields_651a, >- [ 'Computer algorithms.' , 'Computer programming.' ], >+ [ 'Computer algorithms.', 'Computer programming.' ], > 'Copy multivalued field' > ); > delete_field( { record => $record, field => '651' } ); >@@ -904,7 +904,7 @@ subtest 'copy_field' => sub { > { record => $record, field => '650', field_numbers => [2] } > ) > ], >- [ 'The art of computer programming', 'Donald E. Knuth.' ], >+ [ 'Computer programming.', '462' ], > 'Copy a field to existent fields should create a new field' > ); > is_deeply( >@@ -913,7 +913,7 @@ subtest 'copy_field' => sub { > { record => $record, field => '650', field_numbers => [1] } > ) > ], >- [ 'Computer programming.', '462' ], >+ [ 'The art of computer programming', 'Donald E. Knuth.' ], > 'Copy a field to existent fields should create a new field, the original one should not have been updated' > ); > }; >diff --git a/t/db_dependent/MarcModificationTemplates.t b/t/db_dependent/MarcModificationTemplates.t >index c0ec258344..35adf6919d 100755 >--- a/t/db_dependent/MarcModificationTemplates.t >+++ b/t/db_dependent/MarcModificationTemplates.t >@@ -282,8 +282,8 @@ my @fields_245a = Koha::SimpleMARC::read_field({ > subfield => 'a', > }); > is_deeply( \@fields_245a, [ >- 'The art of computer programming', > 'Bad title', >+ 'The art of computer programming', > 'Bad title', > ], 'Copy field has copied the "Bad title"' ); > >@@ -305,8 +305,8 @@ is( ModifyRecordWithTemplate( $template_id, $record ), undef, "The ModifyRecordW > subfield => 'a', > }); > is_deeply( \@fields_245a, [ >- 'The art of computer programming', > 'Bad title updated', >+ 'The art of computer programming', > 'Bad title', > ], 'update_field has update first the "Bad title"' ); > >@@ -328,10 +328,10 @@ is( ModifyRecordWithTemplate( $template_id, $record ), undef, "The ModifyRecordW > subfield => 'a', > }); > is_deeply( \@fields_245a, [ >- 'The art of computer programming', > 'Bad title updated', >- 'Bad title', > 'Bad title updated', >+ 'The art of computer programming', >+ 'Bad title', > ], 'Copy field has copied first "^Bad title"' ); > > # Delete first ^Bad title >@@ -351,9 +351,9 @@ is( ModifyRecordWithTemplate( $template_id, $record ), undef, "The ModifyRecordW > subfield => 'a', > }); > is_deeply( \@fields_245a, [ >+ 'Bad title updated', > 'The art of computer programming', > 'Bad title', >- 'Bad title updated', > ], 'delete field has been deleted the right field"' ); > > is( AddModificationTemplateAction( >@@ -740,12 +740,12 @@ sub expected_record_0 { > a => 'Appolo', > ), > MARC::Field->new( >- 690, ' ', ' ', >+ 690, ' ', '0', > 0 => 'Zeroth', > a => 'Appolo', > ), > MARC::Field->new( >- 690, ' ', '0', >+ 690, ' ', ' ', > 0 => 'Zeroth', > a => 'Appolo', > ), >-- >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 24480
:
97695
|
97944
|
97945
|
98975
|
98976
|
106621
|
112311
|
112312
|
150665
|
150666
|
155714
|
155715
|
155716
|
155717
|
155721
|
155722
|
155723
|
155724
|
158130
|
158131
|
158132
|
158133