};
subtest 'build_query tests' => sub {
- plan tests => 18;
+ plan tests => 20;
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both');
my $query = $builder->build_query();
"query of specific field is truncated"
);
+ ( undef, $query ) = $builder->build_query_compat( undef, ['Local-number:"123456"'] );
+ is(
+ $query->{query}{query_string}{query},
+ '(Local-number:"123456")',
+ "query of specific field including hyphen and quoted is not truncated"
+ );
+
+ ( undef, $query ) = $builder->build_query_compat( undef, ['Local-number:123456'] );
+ is(
+ $query->{query}{query_string}{query},
+ '(Local-number:123456*)',
+ "query of specific field including hyphen and not quoted is truncated"
+ );
+
( undef, $query ) = $builder->build_query_compat( undef, ['title:"donald duck"'] );
is(
$query->{query}{query_string}{query},