Additional unit tests for anchored searches
This MR, as proposed in #94 (closed), adds additional test cases to
tests/anchor/anchor.sh intended to catch errors using anchored matches with the distance parameter specified. Both 0-word- and 1-word-distance searches are added to various anchored scenarios in both the body and title search tests.
The tests rely on an additional test file
tryanchor2.html (attached), expected to be found alongside
<testdata>/anchor/. It is largely a copy of
tryanchor.html, with a few extra strings added at the beginnings and endings of the title and body content.
In setting up to run the tests, I also made two small modifications to
runtests.sh, both included as separate commits:
mkdir -pto create the temp directory, in case
- Remove the rewriting of
rerootResultsshell function. On early runs that file won't exist yet, and even if it does exist it'll be overwritten a few lines later in the script (when
recoll.conf.ininto a new
recoll.conf), so there's no point in trying to edit the contents there.