From c713d1c357be1d29de26906e27f7d02739b93701 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 14 Dec 2022 05:17:02 +0000 Subject: [PATCH] Bug 20596: Add unit test for multiple values in authority search This patch adds a unit test which returns 2 authority records via an implicit OR when searching for strings from two different authority records. Test plan: 1. prove t/db_dependent/Search.t Signed-off-by: Jan Kissig Signed-off-by: Fridolin Somers Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 76d676a868be048ec57c8eb178bf813a12823c6e) Signed-off-by: Martin Renvoize (cherry picked from commit 5921e1c523a9673b8770a9ea2ceb8ec3223ef5de) Signed-off-by: Lucas Gass (cherry picked from commit 8146d064b57a925026a440ccda59c2dfcfd9e1f5) Signed-off-by: Arthur Suzuki --- t/db_dependent/Search.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 9f14d3e26b..0879483d3a 100755 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -742,6 +742,13 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' ); is($count, 1, 'MARC21 authorities: one hit on "all" (entire record) contains "professional wrestler"'); + #NOTE: the 2nd parameter is unused in SearchAuthorities... + ($auths, $count) = SearchAuthorities( + ['Any','Any'], [''], [''], ['contains'], + ['professional wrestler','shakespeare'], 0, 10, '', '', 1 + ); + is($count, 2, 'MARC21 authorities: multiple values create operands implicitly joined by OR'); + # retrieve records that are larger than the MARC limit of 99,999 octets ( undef, $results_hashref, $facets_loop ) = getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef); @@ -909,7 +916,7 @@ sub run_unimarc_search_tests { } subtest 'MARC21 + DOM' => sub { - plan tests => 92; + plan tests => 93; run_marc21_search_tests(); }; -- 2.39.5