From 4bef9a884d91b2b69c327d7ebd84cecebf74cc7e Mon Sep 17 00:00:00 2001 From: bennyyip Date: Sat, 21 Dec 2024 18:24:47 +0800 Subject: [PATCH] Fix test --- test/testpinyinime_unit.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/testpinyinime_unit.cpp b/test/testpinyinime_unit.cpp index b067407..6f2a388 100644 --- a/test/testpinyinime_unit.cpp +++ b/test/testpinyinime_unit.cpp @@ -28,7 +28,8 @@ int main() { ime.dict()->load(PinyinDictionary::SystemDict, LIBIME_BINARY_DIR "/data/sc.dict", PinyinDictFormat::Binary); - ime.setFuzzyFlags(PinyinFuzzyFlag::Inner); + PinyinFuzzyFlags flags = PinyinFuzzyFlag::Inner; + ime.setFuzzyFlags(flags); ime.setScoreFilter(1.0f); ime.setShuangpinProfile( std::make_shared(ShuangpinBuiltinProfile::Xiaohe)); @@ -73,13 +74,13 @@ int main() { BuiltinPinyinCorrectionProfile::Qwerty)); ime.setShuangpinProfile(std::make_shared( *ime.shuangpinProfile(), ime.correctionProfile().get())); + ime.setFuzzyFlags(flags | PinyinFuzzyFlag::Correction); - // FIXME: test failed - // c.type("bkqiln"); - // FCITX_ASSERT(c.candidates().size() == c.candidateSet().size()); - // std::cout << boost::algorithm::join(c.candidateSet(), " ") << std::endl; - // FCITX_ASSERT(c.candidateSet().count("冰淇淋")); - // c.clear(); + c.type("bkqiln"); + FCITX_ASSERT(c.candidates().size() == c.candidateSet().size()); + std::cout << boost::algorithm::join(c.candidateSet(), " ") << std::endl; + FCITX_ASSERT(c.candidateSet().count("冰淇淋")); + c.clear(); c.clear();