diff --git a/test/data/lib_for_server_search_test.xml b/test/data/lib_for_server_search_test.xml index 994c6a6fa..019d46aba 100644 --- a/test/data/lib_for_server_search_test.xml +++ b/test/data/lib_for_server_search_test.xml @@ -1,4 +1,4 @@ - + diff --git a/test/server_search.cpp b/test/server_search.cpp index 6d57e1f8d..37c001141 100644 --- a/test/server_search.cpp +++ b/test/server_search.cpp @@ -1379,6 +1379,36 @@ TEST(ServerSearchTest, searchResults) /* pagination */ {} }, + // books.name filters by the name of the ZIM file + { + /* query */ "pattern=travel" + "&books.name=zimfile", + /* start */ 0, + /* resultsPerPage */ 10, + /* totalResultCount */ 1, + /* firstResultIndex */ 1, + /* results */ { + SEARCH_RESULT_FOR_TRAVEL_IN_RAYCHARLESZIM + }, + + /* pagination */ {} + }, + + // books.name filters by the name of the ZIM file + { + /* query */ "pattern=travel" + "&books.name=example", + /* start */ 0, + /* resultsPerPage */ 10, + /* totalResultCount */ 1, + /* firstResultIndex */ 1, + /* results */ { + SEARCH_RESULT_FOR_TRAVEL_IN_EXAMPLEZIM + }, + + /* pagination */ {} + }, + // Adding a book (without match) doesn't change the results { /* query */ "pattern=jazz"