From 689e00f2c6c809941e0e7625bde4ceb2036766c1 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 14 Apr 2022 12:19:22 +0000 Subject: [PATCH] Bug 30528: Unit tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Renvoize Signed-off-by: Joonas Kylmälä --- t/db_dependent/Search.t | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 15d3e80010..9f14d3e26b 100755 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -637,9 +637,15 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $query_type ) = buildQuery([], [ 'ccl=an:42' ], [], ['available'], [], 0, 'en'); - is( $query, "an:42 and ( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) )", 'buildQuery should add the available part to the query if requested with ccl' ); + is( $query, "an:42 and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))", 'buildQuery should add the available part to the query if requested with ccl' ); is( $query_desc, 'an:42', 'buildQuery should remove the available part from the query' ); + ( $error, $query, $simple_query, $query_cgi, + $query_desc, $limit, $limit_cgi, $limit_desc, + $query_type ) = buildQuery([], [ 'ccl=an:42' ], [], ['branch:CPL'], [], 0, 'en'); + is( $query, "an:42 and (homebranch: CPL or holdingbranch: CPL)", 'buildQuery should expand the limit as necessary for ccl queries' ); + is( $query_desc, 'an:42', 'buildQuery should not add limit to limit desc for ccl queries' ); + ( $error, $query, $simple_query, $query_cgi, $query_desc, $limit, $limit_cgi, $limit_desc, $query_type ) = buildQuery([], [ 0 ], [ 'su,phr' ], [], [], 0, 'en'); @@ -903,7 +909,7 @@ sub run_unimarc_search_tests { } subtest 'MARC21 + DOM' => sub { - plan tests => 90; + plan tests => 92; run_marc21_search_tests(); }; -- 2.30.2