Bug 37333: (follow-up) Update existing tests

We add a level of bracket nesting. I checked with Nick that this
shouldn't cause any issues in the queries and we agreed it made sense so
I've gone ahead and updated the tests to reflect the change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2024-07-22 15:53:48 +01:00
parent 6aadc4a423
commit 21dc76f35b
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 8 additions and 8 deletions

View file

@ -819,9 +819,9 @@ subtest "Handle search filters" => sub {
my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
is( $limit,q{(available:true) AND ((cat) AND title:(bat) OR author:(rat)) AND itype:(("BK") OR ("MU"))},"Limit correctly formed");
is( $limit,q{(available:true) AND (((cat) AND title:(bat) OR author:(rat))) AND itype:(("BK") OR ("MU"))},"Limit correctly formed");
is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
is( $limit_desc,q{(available:true) AND ((cat) AND title:(bat) OR author:(rat)) AND itype:(("BK") OR ("MU"))},"Limit description is correctly expanded");
is( $limit_desc,q{(available:true) AND (((cat) AND title:(bat) OR author:(rat))) AND itype:(("BK") OR ("MU"))},"Limit description is correctly expanded");
$filter = Koha::SearchFilter->new({
name => "test",
@ -832,9 +832,9 @@ subtest "Handle search filters" => sub {
( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
is( $limit,q{(subject:biography)},"Limit correctly formed for ccl type query");
is( $limit,q{((subject:biography))},"Limit correctly formed for ccl type query");
is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
is( $limit_desc,q{(subject:biography)},"Limit description is correctly handled for ccl type query");
is( $limit_desc,q{((subject:biography))},"Limit description is correctly handled for ccl type query");
};

View file

@ -116,9 +116,9 @@ subtest "Handle search filters" => sub {
my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
is( $limit,q{kw=(cat) AND ti=(bat) OR au=(rat) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit correctly formed");
is( $limit,q{(kw=(cat) AND ti=(bat) OR au=(rat)) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit correctly formed");
is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
is( $limit_desc,q{kw=(cat) AND ti=(bat) OR au=(rat) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit description is correctly expanded");
is( $limit_desc,q{(kw=(cat) AND ti=(bat) OR au=(rat)) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit description is correctly expanded");
$filter = Koha::SearchFilter->new({
name => "test",
@ -129,8 +129,8 @@ subtest "Handle search filters" => sub {
( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
is( $limit,q{(su=biography)},"Limit correctly formed for ccl type query");
is( $limit,q{((su=biography))},"Limit correctly formed for ccl type query");
is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
is( $limit_desc,q{(su=biography)},"Limit description is correctly handled for ccl type query");
is( $limit_desc,q{((su=biography))},"Limit description is correctly handled for ccl type query");
};