mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
增加单元测试
This commit is contained in:
parent
64d073d194
commit
d33c09d74a
@ -69,4 +69,13 @@ TEST(ApplicationTest, InsertUserWord) {
|
||||
app.cut("男默女泪", words);
|
||||
result << words;
|
||||
ASSERT_EQ("[\"男默女泪\"]", result);
|
||||
|
||||
for(size_t i = 0; i < 100; i++) {
|
||||
string newWord;
|
||||
newWord << rand();
|
||||
ASSERT_TRUE(app.insertUserWord(newWord));
|
||||
app.cut(newWord, words);
|
||||
result << words;
|
||||
ASSERT_EQ(result, string_format("[\"%s\"]", newWord.c_str()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user