awtk/tests/suggest_test.cc
2023-01-03 18:09:55 +08:00

23 lines
635 B
C++

#include "common.h"
#include "gtest/gtest.h"
#include "base/suggest_words.h"
#include "tests/suggest_test.inc"
TEST(SuggestWords, basic) {
suggest_words_t* sw = suggest_words_create((const asset_info_t*)data_suggest_test);
ASSERT_EQ(suggest_words_find(sw, L""[0]), RET_OK);
ASSERT_EQ(sw->words_nr, 10);
assert_str_eq(L"", sw->words);
ASSERT_EQ(suggest_words_find(sw, L""[0]), RET_OK);
ASSERT_EQ(sw->words_nr, 10u);
assert_str_eq(L"", sw->words);
ASSERT_EQ(suggest_words_find(sw, L""[0]), RET_OK);
ASSERT_EQ(sw->words_nr, 10u);
assert_str_eq(L"", sw->words);
suggest_words_destroy(sw);
}