Skip to content

Commit 1d2a84a

Browse files
authoredSep 25, 2024··
Workaround test failure with latest m17n-db since wijesekera is renamed to wijesekara (#8)
Fix #7
1 parent 5714cca commit 1d2a84a

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed
 

‎test/testm17n.cpp

+15-6
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,21 @@ void scheduleEvent(EventDispatcher *dispatcher, Instance *instance) {
2424
auto *m17n = instance->addonManager().addon("m17n", true);
2525
FCITX_ASSERT(m17n);
2626
auto defaultGroup = instance->inputMethodManager().currentGroup();
27+
std::string wijesekaraName;
28+
if (instance->inputMethodManager().entry("m17n_si_wijesekera")) {
29+
wijesekaraName = "m17n_si_wijesekera";
30+
} else if (instance->inputMethodManager().entry("m17n_si_wijesekara")) {
31+
wijesekaraName = "m17n_si_wijesekara";
32+
} else {
33+
FCITX_ERROR()
34+
<< "wijesekara engine is not available, skip the test";
35+
return;
36+
}
2737
defaultGroup.inputMethodList().clear();
2838
defaultGroup.inputMethodList().push_back(
2939
InputMethodGroupItem("keyboard-us"));
3040
defaultGroup.inputMethodList().push_back(
31-
InputMethodGroupItem("m17n_si_wijesekera"));
41+
InputMethodGroupItem(wijesekaraName));
3242
defaultGroup.setDefaultInputMethod("");
3343
instance->inputMethodManager().setGroup(defaultGroup);
3444
auto *testfrontend = instance->addonManager().addon("testfrontend");
@@ -56,11 +66,10 @@ void scheduleEvent(EventDispatcher *dispatcher, Instance *instance) {
5666
uuid, Key(FcitxKey_braceright), false);
5767
testfrontend->call<ITestFrontend::keyEvent>(uuid, Key("Control+space"),
5868
false);
59-
60-
dispatcher->schedule([dispatcher, instance]() {
61-
dispatcher->detach();
62-
instance->exit();
63-
});
69+
});
70+
dispatcher->schedule([dispatcher, instance]() {
71+
dispatcher->detach();
72+
instance->exit();
6473
});
6574
}
6675

0 commit comments

Comments
 (0)
Please sign in to comment.