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 => 58; |
222 |
plan tests => 62; |
223 |
|
223 |
|
224 |
my $qb; |
224 |
my $qb; |
225 |
|
225 |
|
Lines 578-583
subtest 'build_query tests' => sub {
Link Here
|
578 |
is( $limit, '(author:("Dillinger Escaplan")) AND itype:(("BOOK") OR ("CD"))', "Limit formed correctly when no search terms"); |
578 |
is( $limit, '(author:("Dillinger Escaplan")) AND itype:(("BOOK") OR ("CD"))', "Limit formed correctly when no search terms"); |
579 |
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"); |
579 |
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"); |
580 |
is( $limit_desc,'(author:("Dillinger Escaplan")) AND itype:(("BOOK") OR ("CD"))',"Limit desc formed correctly when no search terms"); |
580 |
is( $limit_desc,'(author:("Dillinger Escaplan")) AND itype:(("BOOK") OR ("CD"))',"Limit desc formed correctly when no search terms"); |
|
|
581 |
|
582 |
( undef, $query ) = $qb->build_query_compat( undef, ['barcode123123'], ['bc'], |
583 |
['acqdate,st-date-normalized= - '] ); |
584 |
is( |
585 |
$query->{query}{query_string}{query}, |
586 |
'(barcode:barcode123123) AND date-of-acquisition.raw:[* TO *]', |
587 |
'If no date all date-of-acquisition are selected' |
588 |
); |
589 |
|
590 |
( undef, $query ) = $qb->build_query_compat( undef, ['barcode123123'], ['bc'], |
591 |
['acqdate,st-date-normalized=2024-08-01 - '] ); |
592 |
is( |
593 |
$query->{query}{query_string}{query}, |
594 |
'(barcode:barcode123123) AND date-of-acquisition.raw:[2024-08-01 TO *]', |
595 |
'Open start date in date range of an st-date-normalized search is handled properly' |
596 |
); |
597 |
|
598 |
( undef, $query ) = $qb->build_query_compat( undef, ['barcode123123'], ['bc'], |
599 |
['acqdate,st-date-normalized= - 2024-08-30'] ); |
600 |
is( |
601 |
$query->{query}{query_string}{query}, |
602 |
'(barcode:barcode123123) AND date-of-acquisition.raw:[* TO 2024-08-30]', |
603 |
'Open end date in date range of an st-date-normalized search is handled properly' |
604 |
); |
605 |
|
606 |
( undef, $query ) = $qb->build_query_compat( undef, ['barcode123123'], ['bc'], |
607 |
['acqdate,st-date-normalized=2024-08-01 - 2024-08-30'] ); |
608 |
is( |
609 |
$query->{query}{query_string}{query}, |
610 |
'(barcode:barcode123123) AND date-of-acquisition.raw:[2024-08-01 TO 2024-08-30]', |
611 |
'Date range in an st-date-normalized search is handled properly' |
612 |
); |
581 |
}; |
613 |
}; |
582 |
|
614 |
|
583 |
|
615 |
|
584 |
- |
|
|