From bab10f5b93abaf9f75a538f291576d4789c30926 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 23 Sep 2013 21:16:57 +0200 Subject: add subsequence_match(str, subseq) utility function --- src/unit_tests.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/unit_tests.cc') diff --git a/src/unit_tests.cc b/src/unit_tests.cc index 589a83fe..e49f7b3a 100644 --- a/src/unit_tests.cc +++ b/src/unit_tests.cc @@ -141,6 +141,11 @@ void test_string() kak_assert(prefix_match("tchou kanaky", "tchou kanaky")); kak_assert(prefix_match("tchou kanaky", "t")); kak_assert(not prefix_match("tchou kanaky", "c")); + + kak_assert(subsequence_match("tchou kanaky", "tknky")); + kak_assert(subsequence_match("tchou kanaky", "knk")); + kak_assert(subsequence_match("tchou kanaky", "tchou kanaky")); + kak_assert(not subsequence_match("tchou kanaky", "tchou kanaky")); } void test_keys() -- cgit v1.2.3