libkiwix/test
Veloman Yunkan 8f2f93371b Changed a test in order to avoid a bug in Xapian
Xapian version 1.4.18 contains a bug in snippet generation caused by
incorrect handling of stemming.

The test-point with a search pattern "beatles" produced snippets with no
highlights of the search term. Debugging showed that the search pattern
"beatles" was transformed to a search term "beatl" which then didn't
match the word "beatles" in the text from which a snippet had to be
extracted.

The test case passed on my development machine as well as for most CI
configurations. However the "Packages / build-deb (ubuntu-bionic)"
variant failed because of a slightly different handling of punctuation
at the snippet boundaries:

Test context:
  url: /ROOT/search?pattern=beatles&content=zimfile
  actual snippet:   ...side "Yellow Submarine" ...........
  expected snippet: ...-side "Yellow Submarine" ...........

Above mismatch resulted in a looser comparison of the snippet contents
and failed the requirement that the snippet MUST contain highlights
(this is how the said bug in Xapian was discovered).

An attempt to change the search pattern to "field" didn't eliminate the
problem. Despite the search pattern itself being in singular form (i.e.
identical to its stemmed version) the plural form "fields" in the
snippet was still not highlighted.

Using for a search pattern an adjective instead of a noun achieved the
desired outcome.
2022-05-18 13:28:52 +04:00
..
data Unit test for HTTP 500 Internal Server Error 2022-04-04 18:35:20 +02:00
book.cpp Deprecate methods on Book. 2022-01-12 18:07:46 +01:00
counterParsing.cpp Adapt kiwix-lib to the new libzim api. 2020-12-02 12:16:48 +01:00
httplib.h Fix warning in httplib. 2021-11-16 09:39:56 +01:00
kiwixserve.cpp Fix tests. 2020-01-20 17:00:18 +01:00
library.cpp Handling of <dc:issued> in OPDS import 2022-02-23 14:20:49 +01:00
manager.cpp Manager::reload() 2021-11-30 18:20:27 +04:00
meson.build Unit test for HTTP 500 Internal Server Error 2022-04-04 18:35:20 +02:00
name_mapper.cpp Dropped Library::getBookBy*() non-const functions 2021-11-30 18:20:27 +04:00
opds_catalog.cpp OpdsCatalog::getSearchUrl() 2021-06-30 18:27:00 +02:00
pathTools.cpp Do not include posix header on Windows 2022-01-19 16:15:59 +01:00
regex.cpp Move all public *Tools.h in src. 2021-07-07 14:43:13 +02:00
server.cpp Changed a test in order to avoid a bug in Xapian 2022-05-18 13:28:52 +04:00
stringTools.cpp Better parsing of `M/Counter` 2020-10-28 16:03:18 +01:00
tagParsing.cpp Fix tests. 2020-01-20 17:00:18 +01:00