summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_querycompleter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_querycompleter.cpp b/tests/test_querycompleter.cpp
index 1d06f4b..aead30d 100644
--- a/tests/test_querycompleter.cpp
+++ b/tests/test_querycompleter.cpp
@@ -139,13 +139,17 @@ void TestQueryCompleter::rangeUpperBoundCompletes()
void TestQueryCompleter::rangeLowerBoundCompletes()
{
- // Cursor sits at offset 8, before the "..".
- const QString text = QStringLiteral("date:las..today");
+ // Cursor sits at offset 8, mid-way through the lower bound rather than at
+ // its end. End-of-bound would not discriminate: there the whole-bound span
+ // and the typed-so-far span happen to be the same length.
+ const QString text = QStringLiteral("date:lastweek..today");
const CompletionContext ctx = completionContext(text, 8);
QCOMPARE(ctx.kind, CompletionContext::Value);
QCOMPARE(ctx.stem, QStringLiteral("las"));
QCOMPARE(ctx.replaceFrom, 5);
- QCOMPARE(ctx.replaceLength, 3);
+ // Covers the whole lower bound, so accepting leaves no "tweek" tail.
+ QCOMPARE(ctx.replaceLength, 8);
+ QVERIFY(!ctx.allowRangeEntries);
}
void TestQueryCompleter::bareValueAllowsRelativeEntries()