awtk/tests/suggest_test.cc
2018-06-27 13:46:42 +08:00

22 lines
631 B
C++

#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 resource_info_t*)data_suggest_test);
ASSERT_EQ(suggest_words_find(sw, L""[0]), RET_OK);
ASSERT_EQ(sw->words_nr, 2);
ASSERT_EQ(strcmp(sw->words, ""), 0);
ASSERT_EQ(suggest_words_find(sw, L""[0]), RET_OK);
ASSERT_EQ(sw->words_nr, 2);
ASSERT_EQ(strcmp(sw->words, ""), 0);
ASSERT_EQ(suggest_words_find(sw, L""[0]), RET_OK);
ASSERT_EQ(sw->words_nr, 6);
ASSERT_EQ(strcmp(sw->words, ""), 0);
suggest_words_destroy(sw);
}