Bug 19559: Add tests

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2017-11-01 15:46:59 +00:00 committed by Jonathan Druart
parent 2fe0a816fe
commit 26be355fe8

View file

@ -81,7 +81,7 @@ subtest 'json2marc' => sub {
};
subtest 'build_query tests' => sub {
plan tests => 18;
plan tests => 20;
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both');
my $query = $builder->build_query();
@ -172,6 +172,20 @@ subtest 'build_query tests' => sub {
"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},