From 935ed2876b3902ca5e2dfa2cc258baf6fc464ab3 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 28 Oct 2013 15:34:15 +0000 Subject: [PATCH] Bug 10271: regression test for search using indexes containing 'ns' This patch adds a regression test for doing a form-based catalog search using an index that contains the string 'ns' in its name. In this case, the index being tested is 'Code-institution'. To test ------- [1] Prove -v t/db_dependent/Search.t should have two failed tests; one each for GRS-1 and DOM testing. [2] After applying the main patch for this bug, the tests should pass. Signed-off-by: Galen Charlton --- t/db_dependent/Search.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 1c4af2124d..d4bb05bc2f 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -12,7 +12,7 @@ use YAML; use C4::Debug; require C4::Context; -use Test::More tests => 194; +use Test::More tests => 196; use Test::MockModule; use MARC::Record; use File::Spec; @@ -451,6 +451,12 @@ sub run_marc21_search_tests { ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated multi-faceted search matched right number of records"); + ( $error, $query, $simple_query, $query_cgi, + $query_desc, $limit, $limit_cgi, $limit_desc, + $stopwords_removed, $query_type ) = buildQuery([], [ 'NEKLS' ], [ 'Code-institution' ], [], [], 0, 'en'); + ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); + is($results_hashref->{biblioserver}->{hits}, 12, + 'search using index whose name contains "ns" returns expected results (bug 10271)'); # FIXME: the availability limit does not actually work, so for the moment we # are just checking that it behaves consistently -- 2.39.5