fix: correct Katakana composition

This commit is contained in:
2026-08-12 15:29:35 +09:00
parent ec7e6eb992
commit 6dfbc08704
5 changed files with 62 additions and 3 deletions

View File

@@ -481,6 +481,41 @@ engine_japanese_backspace_and_boundaries(struct ct *t)
}
}
void
engine_katakana_sequences(struct ct *t)
{
static const struct {
char *keys;
char *want;
} cases[] = {
{ "kitte", "キッテ" },
{ "katta", "カッタ" },
{ "gakkou", "ガッコウ" },
{ "matcha", "マッチャ" },
{ "xu", "" },
{ "vu", "" },
};
Dictreq req;
Str com, shown;
int i;
newestrequest(&req);
for(i = 0; i < nelem(cases); i++){
init();
im.l = getlang(LangJPK);
sclear(&com);
if(!typekeys(t, cases[i].keys, &com))
continue;
checkstr(t, cases[i].keys, "", &com);
shown = shownpre(&im);
checkstr(t, cases[i].keys, cases[i].want, &shown);
CT_CHECK(t, keystroke(Kret, 0, &com));
checkstr(t, "committed Katakana", cases[i].want, &com);
}
CT_EQ_INT(t, 0, newestrequest(&req));
CT_EQ_PTR(t, nil, getlang(LangJPK)->dictname);
}
void
engine_emoji_single_candidate(struct ct *t)
{