From 909fc02778bf5db5953a266a9aeff0291552b6cf Mon Sep 17 00:00:00 2001 From: oirfeodent Date: Wed, 7 Sep 2016 13:49:08 +1000 Subject: Add InListAbridged to WordList. --- test/unit/testWordList.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/unit') 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", '~')); + } } -- cgit v1.2.3