Bugzilla – Attachment 192319 Details for
Bug 41685
MARC21: Sort 4xx/5xx in BuildSummary alphabetic within hierarchy ($w: g or h)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41685: Unit tests
Bug-41685-Unit-tests.patch (text/plain), 1.81 KB, created by
Marcel de Rooy
on 2026-02-02 13:51:07 UTC
(
hide
)
Description:
Bug 41685: Unit tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2026-02-02 13:51:07 UTC
Size:
1.81 KB
patch
obsolete
>From 0e28aad1fed19a675ea120be9847c9cdbb434d62 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 2 Feb 2026 14:12:10 +0100 >Subject: [PATCH] Bug 41685: Unit tests >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/AuthoritiesMarc.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/AuthoritiesMarc.t | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t >index e223ddba34..681f428e0b 100755 >--- a/t/db_dependent/AuthoritiesMarc.t >+++ b/t/db_dependent/AuthoritiesMarc.t >@@ -6,7 +6,7 @@ > use Modern::Perl; > > use Test::NoWarnings; >-use Test::More tests => 14; >+use Test::More tests => 15; > use Test::MockModule; > use Test::Warn; > use MARC::Field; >@@ -398,3 +398,22 @@ subtest 'DelAuthority() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'BuildSummary/_marc21_sort_hierarchy_alpha' => sub { >+ plan tests => 1; >+ #$schema->storage->txn_begin; >+ #t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); >+ >+ my @fields; >+ push @fields, MARC::Field->new( '550', '', '', a => 'zzz', w => 'h' ); >+ push @fields, MARC::Field->new( '550', '', '', a => 'yyy', w => 'g' ); >+ push @fields, MARC::Field->new( '550', '', '', a => 'xxx', w => 'x' ); >+ push @fields, MARC::Field->new( '550', '', '', a => 'www', w => '' ); >+ push @fields, MARC::Field->new( '550', '', '', a => 'vvv', w => 'g' ); >+ push @fields, MARC::Field->new( '550', '', '', a => 'uuu', w => 'h' ); >+ >+ my @sorted_sub_a = map { $_->subfield('a') } C4::AuthoritiesMarc::_marc21_sort_hierarchy_alpha(@fields); >+ is_deeply( \@sorted_sub_a, [ 'vvv', 'yyy', 'www', 'xxx', 'uuu', 'zzz' ], 'Sorted as expected' ); >+ >+ #$schema->storage->txn_rollback; >+}; >-- >2.39.5
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 41685
:
192118
|
192318
| 192319