Skip to content

Commit

Permalink
Workaround test failure with latest m17n-db since wijesekera is renam…
Browse files Browse the repository at this point in the history
…ed to wijesekara (#8)

Fix #7
  • Loading branch information
wengxt authored Sep 25, 2024
1 parent 5714cca commit 1d2a84a
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions test/testm17n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,21 @@ void scheduleEvent(EventDispatcher *dispatcher, Instance *instance) {
auto *m17n = instance->addonManager().addon("m17n", true);
FCITX_ASSERT(m17n);
auto defaultGroup = instance->inputMethodManager().currentGroup();
std::string wijesekaraName;
if (instance->inputMethodManager().entry("m17n_si_wijesekera")) {
wijesekaraName = "m17n_si_wijesekera";
} else if (instance->inputMethodManager().entry("m17n_si_wijesekara")) {
wijesekaraName = "m17n_si_wijesekara";
} else {
FCITX_ERROR()
<< "wijesekara engine is not available, skip the test";
return;
}
defaultGroup.inputMethodList().clear();
defaultGroup.inputMethodList().push_back(
InputMethodGroupItem("keyboard-us"));
defaultGroup.inputMethodList().push_back(
InputMethodGroupItem("m17n_si_wijesekera"));
InputMethodGroupItem(wijesekaraName));
defaultGroup.setDefaultInputMethod("");
instance->inputMethodManager().setGroup(defaultGroup);
auto *testfrontend = instance->addonManager().addon("testfrontend");
Expand Down Expand Up @@ -56,11 +66,10 @@ void scheduleEvent(EventDispatcher *dispatcher, Instance *instance) {
uuid, Key(FcitxKey_braceright), false);
testfrontend->call<ITestFrontend::keyEvent>(uuid, Key("Control+space"),
false);

dispatcher->schedule([dispatcher, instance]() {
dispatcher->detach();
instance->exit();
});
});
dispatcher->schedule([dispatcher, instance]() {
dispatcher->detach();
instance->exit();
});
}

Expand Down

0 comments on commit 1d2a84a

Please sign in to comment.