aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unit/testDocument.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-07-17 10:04:20 +1000
committerNeil <nyamatongwe@gmail.com>2021-07-17 10:04:20 +1000
commitbea9d7216879bc80a8513d3374a931cba14f6951 (patch)
tree0a34eab53e9e7e8c3b91fec994f64b1bfba42df9 /test/unit/testDocument.cxx
parent046b280114d11ff24b179dbe4df44127e80d39b5 (diff)
downloadscintilla-mirror-bea9d7216879bc80a8513d3374a931cba14f6951.tar.gz
Fix minor inconsistency with word searching results at start and end of document
which were considered word start / end positions even when first or last character did not fit requirements.
Diffstat (limited to 'test/unit/testDocument.cxx')
-rw-r--r--test/unit/testDocument.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/testDocument.cxx b/test/unit/testDocument.cxx
index 0f8e399fa..809647e19 100644
--- a/test/unit/testDocument.cxx
+++ b/test/unit/testDocument.cxx
@@ -477,4 +477,12 @@ TEST_CASE("Words") {
REQUIRE(docOverSpace.document.IsWordAt(1, 4));
}
+ SECTION("WordsAtEnds") {
+ const DocPlus doc("a c", 0);
+ REQUIRE(doc.document.IsWordAt(0, 1));
+ REQUIRE(doc.document.IsWordAt(2, 3));
+ const DocPlus docEndSpace(" a c ", 0);
+ REQUIRE(!docEndSpace.document.IsWordAt(0, 2));
+ REQUIRE(!docEndSpace.document.IsWordAt(3, 5));
+ }
}