Lines 219-225
subtest 'build_authorities_query_compat() tests' => sub {
Link Here
|
219 |
}; |
219 |
}; |
220 |
|
220 |
|
221 |
subtest 'build_query tests' => sub { |
221 |
subtest 'build_query tests' => sub { |
222 |
plan tests => 61; |
222 |
plan tests => 65; |
223 |
|
223 |
|
224 |
my $qb; |
224 |
my $qb; |
225 |
|
225 |
|
Lines 670-675
subtest 'build_query tests' => sub {
Link Here
|
670 |
is( $limit, '(author:("Dillinger Escaplan")) AND itype:(("BOOK") OR ("CD"))', "Limit formed correctly when no search terms"); |
670 |
is( $limit, '(author:("Dillinger Escaplan")) AND itype:(("BOOK") OR ("CD"))', "Limit formed correctly when no search terms"); |
671 |
is( $limit_cgi,'&limit=author%3ADillinger%20Escaplan&limit=mc-itype%2Cphr%3ABOOK&limit=mc-itype%2Cphr%3ACD', "Limit CGI formed correctly when no search terms"); |
671 |
is( $limit_cgi,'&limit=author%3ADillinger%20Escaplan&limit=mc-itype%2Cphr%3ABOOK&limit=mc-itype%2Cphr%3ACD', "Limit CGI formed correctly when no search terms"); |
672 |
is( $limit_desc,'(author:("Dillinger Escaplan")) AND itype:(("BOOK") OR ("CD"))',"Limit desc formed correctly when no search terms"); |
672 |
is( $limit_desc,'(author:("Dillinger Escaplan")) AND itype:(("BOOK") OR ("CD"))',"Limit desc formed correctly when no search terms"); |
|
|
673 |
|
674 |
( undef, $query ) = $qb->build_query_compat( undef, ['barcode123123'], ['bc'], |
675 |
['acqdate,st-date-normalized= - '] ); |
676 |
is( |
677 |
$query->{query}{query_string}{query}, |
678 |
'(barcode:barcode123123) AND date-of-acquisition.raw:[* TO *]', |
679 |
'If no date all date-of-acquisition are selected' |
680 |
); |
681 |
|
682 |
( undef, $query ) = $qb->build_query_compat( undef, ['barcode123123'], ['bc'], |
683 |
['acqdate,st-date-normalized=2024-08-01 - '] ); |
684 |
is( |
685 |
$query->{query}{query_string}{query}, |
686 |
'(barcode:barcode123123) AND date-of-acquisition.raw:[2024-08-01 TO *]', |
687 |
'Open start date in date range of an st-date-normalized search is handled properly' |
688 |
); |
689 |
|
690 |
( undef, $query ) = $qb->build_query_compat( undef, ['barcode123123'], ['bc'], |
691 |
['acqdate,st-date-normalized= - 2024-08-30'] ); |
692 |
is( |
693 |
$query->{query}{query_string}{query}, |
694 |
'(barcode:barcode123123) AND date-of-acquisition.raw:[* TO 2024-08-30]', |
695 |
'Open end date in date range of an st-date-normalized search is handled properly' |
696 |
); |
697 |
|
698 |
( undef, $query ) = $qb->build_query_compat( undef, ['barcode123123'], ['bc'], |
699 |
['acqdate,st-date-normalized=2024-08-01 - 2024-08-30'] ); |
700 |
is( |
701 |
$query->{query}{query_string}{query}, |
702 |
'(barcode:barcode123123) AND date-of-acquisition.raw:[2024-08-01 TO 2024-08-30]', |
703 |
'Date range in an st-date-normalized search is handled properly' |
704 |
); |
673 |
}; |
705 |
}; |
674 |
|
706 |
|
675 |
|
707 |
|
676 |
- |
|
|