summaryrefslogtreecommitdiffstats
path: root/streamingvisitors/src/tests/searcher/searcher_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'streamingvisitors/src/tests/searcher/searcher_test.cpp')
-rw-r--r--streamingvisitors/src/tests/searcher/searcher_test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/streamingvisitors/src/tests/searcher/searcher_test.cpp b/streamingvisitors/src/tests/searcher/searcher_test.cpp
index 705e14c11a5..eb233db9632 100644
--- a/streamingvisitors/src/tests/searcher/searcher_test.cpp
+++ b/streamingvisitors/src/tests/searcher/searcher_test.cpp
@@ -729,6 +729,14 @@ TEST("utf8 flexible searcher handles regexes with explicit anchoring") {
TEST_DO(assertString(fs, "#^foo$", "oo", Hits()));
}
+TEST("utf8 flexible searcher regex matching treats field as 1 word") {
+ UTF8FlexibleStringFieldSearcher fs(0);
+ // Match case
+ TEST_DO(assertFieldInfo(fs, "#.*", "foo bar baz", QTFieldInfo(0, 1, 1)));
+ // Mismatch case
+ TEST_DO(assertFieldInfo(fs, "#^zoid$", "foo bar baz", QTFieldInfo(0, 0, 1)));
+}
+
TEST("utf8 flexible searcher handles fuzzy search in uncased mode") {
UTF8FlexibleStringFieldSearcher fs(0);
// Term syntax (only applies to these tests):
@@ -819,6 +827,14 @@ TEST("utf8 flexible searcher caps oversized fuzzy prefix length to term length")
TEST_DO(assertString(fs, "%{5,9001}zoid", "boid", Hits()));
}
+TEST("utf8 flexible searcher fuzzy matching treats field as 1 word") {
+ UTF8FlexibleStringFieldSearcher fs(0);
+ // Match case
+ TEST_DO(assertFieldInfo(fs, "%{1}foo bar baz", "foo jar baz", QTFieldInfo(0, 1, 1)));
+ // Mismatch case
+ TEST_DO(assertFieldInfo(fs, "%{1}foo", "foo bar baz", QTFieldInfo(0, 0, 1)));
+}
+
TEST("bool search") {
BoolFieldSearcher fs(0);
TEST_DO(assertBool(fs, "true", true, true));