Bugzilla – Attachment 147885 Details for
Bug 33100
Authority linking doesn't work for bib headings ending in two or more punctuation characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33100: Unit test
Bug-33100-Unit-test.patch (text/plain), 1.90 KB, created by
Nick Clemens (kidclamp)
on 2023-03-07 20:09:38 UTC
(
hide
)
Description:
Bug 33100: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-03-07 20:09:38 UTC
Size:
1.90 KB
patch
obsolete
>From 2b9e39b66bffe1efca974d953b2b8f3df5147284 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 7 Mar 2023 20:05:28 +0000 >Subject: [PATCH] Bug 33100: Unit test > >--- > t/db_dependent/Heading.t | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Heading.t b/t/db_dependent/Heading.t >index 9a21534828..4fb5f8241e 100755 >--- a/t/db_dependent/Heading.t >+++ b/t/db_dependent/Heading.t >@@ -64,7 +64,7 @@ subtest "UNIMARC tests" => sub { > }; > > subtest "_search tests" => sub { >- plan tests => 4; >+ plan tests => 5; > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > t::lib::Mocks::mock_preference('SearchEngine', 'Elasticsearch'); >@@ -112,9 +112,19 @@ subtest "_search tests" => sub { > $search_query = $heading->_search( 'match-heading' ); > $terms = $search_query->{query}->{bool}->{must}; > $expected_terms = [ >- { term => { 'match-heading.ci_raw' => 'Yankovic, Al 1959-' } }, >+ { term => { 'match-heading.ci_raw' => 'Yankovic, Al 1959' } }, > { term => { 'subject-heading-thesaurus.ci_raw' => 'a' } }, > ]; >- is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field"); >+ is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with doulbe punctuation, hyphen+comma"); >+ >+ $field = MARC::Field->new( '100', ' ', '', a => 'Tolkien, J.R.R.,', e => '[author]' ); >+ $heading = C4::Heading->new_from_field($field); >+ $search_query = $heading->_search( 'match-heading' ); >+ $terms = $search_query->{query}->{bool}->{must}; >+ $expected_terms = [ >+ { term => { 'match-heading.ci_raw' => 'Tolkien, J.R.R' } }, >+ { term => { 'subject-heading-thesaurus.ci_raw' => 'a' } }, >+ ]; >+ is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with double punctuation, period+comma "); > > }; >-- >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 33100
:
147885
|
147886
|
148030
|
148031
|
148225
|
148226
|
148337