aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/testWordList.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/testWordList.cxx b/test/unit/testWordList.cxx
index a4ccf4d6a..e5874c01c 100644
--- a/test/unit/testWordList.cxx
+++ b/test/unit/testWordList.cxx
@@ -29,4 +29,26 @@ TEST_CASE("WordList") {
REQUIRE(0 == strcmp(wl.WordAt(0), "else"));
}
+ SECTION("InListAbridged") {
+ wl.Set("list w.~.active bo~k a~z ~_frozen");
+ REQUIRE(wl.InListAbridged("list", '~'));
+
+ REQUIRE(wl.InListAbridged("w.front.active", '~'));
+ REQUIRE(wl.InListAbridged("w.x.active", '~'));
+ REQUIRE(wl.InListAbridged("w..active", '~'));
+ REQUIRE(!wl.InListAbridged("w.active", '~'));
+ REQUIRE(!wl.InListAbridged("w.x.closed", '~'));
+
+ REQUIRE(wl.InListAbridged("book", '~'));
+ REQUIRE(wl.InListAbridged("bok", '~'));
+ REQUIRE(!wl.InListAbridged("bk", '~'));
+
+ REQUIRE(wl.InListAbridged("a_frozen", '~'));
+ REQUIRE(wl.InListAbridged("_frozen", '~'));
+ REQUIRE(!wl.InListAbridged("frozen", '~'));
+
+ REQUIRE(wl.InListAbridged("abcz", '~'));
+ REQUIRE(wl.InListAbridged("abz", '~'));
+ REQUIRE(wl.InListAbridged("az", '~'));
+ }
}