diff options
author | oirfeodent <unknown> | 2016-09-07 13:55:11 +1000 |
---|---|---|
committer | oirfeodent <unknown> | 2016-09-07 13:55:11 +1000 |
commit | c0fe4b0747d3abd22b6113ba8fbbfdaf029bb7c1 (patch) | |
tree | d51e2b001058808124a7ce6e76e8ba2f43fc5b6e | |
parent | 909fc02778bf5db5953a266a9aeff0291552b6cf (diff) | |
download | scintilla-mirror-c0fe4b0747d3abd22b6113ba8fbbfdaf029bb7c1.tar.gz |
Add test cases for WordList::InListAbbreviated.
-rw-r--r-- | test/unit/testWordList.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/testWordList.cxx b/test/unit/testWordList.cxx index e5874c01c..7abedd157 100644 --- a/test/unit/testWordList.cxx +++ b/test/unit/testWordList.cxx @@ -29,6 +29,22 @@ TEST_CASE("WordList") { REQUIRE(0 == strcmp(wl.WordAt(0), "else")); } + SECTION("InListAbbreviated") { + wl.Set("else stru~ct w~hile"); + REQUIRE(wl.InListAbbreviated("else", '~')); + + REQUIRE(wl.InListAbbreviated("struct", '~')); + REQUIRE(wl.InListAbbreviated("stru", '~')); + REQUIRE(wl.InListAbbreviated("struc", '~')); + REQUIRE(!wl.InListAbbreviated("str", '~')); + + REQUIRE(wl.InListAbbreviated("while", '~')); + REQUIRE(wl.InListAbbreviated("wh", '~')); + // TODO: Next line fails but should allow single character prefixes + //REQUIRE(wl.InListAbbreviated("w", '~')); + REQUIRE(!wl.InListAbbreviated("", '~')); + } + SECTION("InListAbridged") { wl.Set("list w.~.active bo~k a~z ~_frozen"); REQUIRE(wl.InListAbridged("list", '~')); |