From 389308dfd812a499df5dac86d98c8e1be9604dea Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 22 Apr 2014 19:31:31 +0100 Subject: Preserve current word in word completion if found elsewhere If occurence count in the buffer if greater that one, do not remove it from the matches. --- src/unit_tests.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/unit_tests.cc') diff --git a/src/unit_tests.cc b/src/unit_tests.cc index 66fe53f2..e26ce611 100644 --- a/src/unit_tests.cc +++ b/src/unit_tests.cc @@ -80,6 +80,8 @@ void test_word_db() auto res = word_db.find_prefix(""); std::sort(res.begin(), res.end()); kak_assert(res == std::vector{ "allo" COMMA "kanaky" COMMA "mutch" COMMA "tchaa" COMMA "tchou" }); + kak_assert(word_db.get_word_occurences("tchou") == 3); + kak_assert(word_db.get_word_occurences("allo") == 1); buffer.erase(buffer.iterator_at({1, 6}), buffer.iterator_at({4, 0})); res = word_db.find_prefix(""); std::sort(res.begin(), res.end()); -- cgit v1.2.3