From 5f4dad60b91931470b480352908251569eae63ba Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 5 Jun 2023 15:11:06 +0200 Subject: [PATCH] Add a new test, showing accents is not properly handle in search endpoint. --- test/server_search.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/server_search.cpp b/test/server_search.cpp index a73a33d02..bb88ac890 100644 --- a/test/server_search.cpp +++ b/test/server_search.cpp @@ -1456,6 +1456,33 @@ TEST(ServerSearchTest, searchResults) { "▶", 40, false }, } }, + + // Be sure that searching with accented query return the same things than non accented query. + { + /* query */ "pattern=j%C3%A0zz" + "&books.filter.lang=eng" + "&books.filter.title=Ray%20Charles", + /* start */ -1, + /* resultsPerPage */ 5, + /* totalResultCount */ 44, + /* firstResultIndex */ 1, + /* results */ { + LARGE_SEARCH_RESULTS[0], + LARGE_SEARCH_RESULTS[1], + LARGE_SEARCH_RESULTS[2], + LARGE_SEARCH_RESULTS[3], + LARGE_SEARCH_RESULTS[4], + }, + + /* pagination */ { + { "1", 0, true }, + { "2", 5, false }, + { "3", 10, false }, + { "4", 15, false }, + { "5", 20, false }, + { "▶", 40, false }, + } + }, }; ZimFileServer zfs(SERVER_PORT, ZimFileServer::DEFAULT_OPTIONS,