From 6ef4f6396ee6d09d43884f3f117b67d85ce8be5e Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Tue, 5 Mar 2024 16:42:14 +0400 Subject: [PATCH] Testing of filtering during search by books.filter.name --- test/server_search.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/server_search.cpp b/test/server_search.cpp index 37c001141..06f35aba7 100644 --- a/test/server_search.cpp +++ b/test/server_search.cpp @@ -1409,6 +1409,36 @@ TEST(ServerSearchTest, searchResults) /* pagination */ {} }, + // books.filter.name filters by the book name + { + /* query */ "pattern=travel" + "&books.filter.name=wikipedia_en_ray_charles", + /* start */ 0, + /* resultsPerPage */ 10, + /* totalResultCount */ 1, + /* firstResultIndex */ 1, + /* results */ { + SEARCH_RESULT_FOR_TRAVEL_IN_RAYCHARLESZIM + }, + + /* pagination */ {} + }, + + // books.filter.name filters by the book name + { + /* query */ "pattern=travel" + "&books.filter.name=bookname_of_example_zim", + /* 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"