Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyyip committed Dec 21, 2024
1 parent 1517f23 commit 4bef9a8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/testpinyinime_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ShuangpinProfile>(ShuangpinBuiltinProfile::Xiaohe));
Expand Down Expand Up @@ -73,13 +74,13 @@ int main() {
BuiltinPinyinCorrectionProfile::Qwerty));
ime.setShuangpinProfile(std::make_shared<libime::ShuangpinProfile>(
*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();

Expand Down

0 comments on commit 4bef9a8

Please sign in to comment.