Bug 10271: regression test for search using indexes containing 'ns'
authorGalen Charlton <gmc@esilibrary.com>
Mon, 28 Oct 2013 15:34:15 +0000 (15:34 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 28 Oct 2013 16:10:33 +0000 (16:10 +0000)
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 <gmc@esilibrary.com>
t/db_dependent/Search.t

index 1c4af21..d4bb05b 100644 (file)
@@ -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