diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-10-01 00:20:12 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-10-01 00:20:12 +0100 |
| commit | d55d041c6aa9941cc74853e4b2bf6620773c84c1 (patch) | |
| tree | 702ed4e245190845036d7523523fd0729ceeba81 /src/unit_tests.cc | |
| parent | d9e462851c4b18b80b478956ed20fb0be8a1d640 (diff) | |
Add support for interned strings
Use interned strings for Modification contents and word database.
Interned strings are guaranteed not to move in memory and are
reference counted.
Diffstat (limited to 'src/unit_tests.cc')
| -rw-r--r-- | src/unit_tests.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/unit_tests.cc b/src/unit_tests.cc index 3795b8a5..3c9e5c17 100644 --- a/src/unit_tests.cc +++ b/src/unit_tests.cc @@ -82,17 +82,17 @@ void test_word_db() WordDB word_db(buffer); 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(res == std::vector<InternedString>{ "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()); - kak_assert(res == std::vector<String>{ "allo" COMMA "mutch" COMMA "tchou" }); + kak_assert(res == std::vector<InternedString>{ "allo" COMMA "mutch" COMMA "tchou" }); buffer.insert(buffer.iterator_at({1, 0}), "re"); res = word_db.find_prefix(""); std::sort(res.begin(), res.end()); - kak_assert(res == std::vector<String>{ "allo" COMMA "mutch" COMMA "retchou" COMMA "tchou" }); + kak_assert(res == std::vector<InternedString>{ "allo" COMMA "mutch" COMMA "retchou" COMMA "tchou" }); } void test_utf8() |
