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:
parent
2fe0a816fe
commit
26be355fe8
1 changed files with 15 additions and 1 deletions
|
@ -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},
|
||||
|
|
Loading…
Reference in a new issue