From ca2e18d5e4262f47cba9dc7743b26bfcfd082255 Mon Sep 17 00:00:00 2001 From: Nick Clemens 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 Signed-off-by: Phil Ringnalda --- 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.40.0