summaryrefslogtreecommitdiff
path: root/src/unit_tests.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-04-22 19:31:31 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-04-22 19:32:12 +0100
commit389308dfd812a499df5dac86d98c8e1be9604dea (patch)
tree8f52f1b99ab25d41f0527acdec89262b6ae04c84 /src/unit_tests.cc
parent65c818b85970135f9fff3b71432d2a8f331f8526 (diff)
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.
Diffstat (limited to 'src/unit_tests.cc')
-rw-r--r--src/unit_tests.cc2
1 files changed, 2 insertions, 0 deletions
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<String>{ "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());