nixosTests.fcitx5: unbreak, add rest of CJK

Changed files
+46 -23
nixos
tests
+33 -22
nixos/tests/fcitx5/default.nix
···
-
import ../make-test-python.nix ({ pkgs, ... }:
-
# copy_from_host works only for store paths
+
import ../make-test-python.nix ({ lib, ... }:
rec {
name = "fcitx5";
+
meta.maintainers = with lib.maintainers; [ nevivurn ];
+
nodes.machine = { pkgs, ... }:
{
imports = [
···
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = [
-
pkgs.fcitx5-m17n
pkgs.fcitx5-chinese-addons
+
pkgs.fcitx5-hangul
+
pkgs.fcitx5-m17n
+
pkgs.fcitx5-mozc
];
};
};
···
fcitx_confdir = "${user.home}/.config/fcitx5";
in
''
-
# We need config files before login session
-
# So copy first thing
+
start_all()
-
# Point and click would be expensive,
-
# So configure using files
+
machine.wait_for_x()
+
machine.wait_for_file("${xauth}")
+
machine.succeed("xauth merge ${xauth}")
+
machine.sleep(5)
+
+
machine.succeed("su - ${user.name} -c 'kill $(pgrep fcitx5)'")
+
machine.sleep(1)
+
machine.copy_from_host(
"${./profile}",
"${fcitx_confdir}/profile",
···
"${fcitx_confdir}/config",
)
-
start_all()
-
-
machine.wait_for_file("${xauth}}")
-
machine.succeed("xauth merge ${xauth}")
-
-
machine.sleep(5)
-
-
machine.succeed("su - ${user.name} -c 'alacritty&'")
-
machine.succeed("su - ${user.name} -c 'fcitx5&'")
+
machine.succeed("su - ${user.name} -c 'alacritty >&2 &'")
+
machine.succeed("su - ${user.name} -c 'fcitx5 >&2 &'")
machine.sleep(10)
### Type on terminal
···
### Start fcitx Unicode input
machine.send_key("ctrl-alt-shift-u")
-
machine.sleep(5)
machine.sleep(1)
### Search for smiling face
···
machine.sleep(1)
### Default wubi, enter 一下
-
machine.send_chars("gggh")
+
machine.send_chars("gggh ")
machine.sleep(1)
-
machine.send_key("\n")
+
+
### Switch to Hangul
+
machine.send_key("alt-shift")
+
machine.sleep(1)
+
+
### Enter 한
+
machine.send_chars("gks")
machine.sleep(1)
### Switch to Harvard Kyoto
···
machine.sleep(1)
### Enter क
-
machine.send_chars("ka ")
+
machine.send_chars("ka")
machine.sleep(1)
+
### Switch to Mozc
machine.send_key("alt-shift")
machine.sleep(1)
+
### Enter か
+
machine.send_chars("ka\n")
+
machine.sleep(1)
+
### Turn off Fcitx
machine.send_key("ctrl-spc")
machine.sleep(1)
···
### Verify that file contents are as expected
file_content = machine.succeed("cat ${user.home}/fcitx_test.out")
-
assert file_content == "☺一下क\n"
-
''
+
assert file_content == "☺一下한कか\n"
+
''
;
})
+13 -1
nixos/tests/fcitx5/profile
···
DefaultIM=wbx
[Groups/0/Items/0]
+
Name=keyboard-us
+
Layout=
+
+
[Groups/0/Items/1]
Name=wbx
Layout=us
-
[Groups/0/Items/1]
+
[Groups/0/Items/2]
+
Name=hangul
+
Layout=us
+
+
[Groups/0/Items/3]
Name=m17n_sa_harvard-kyoto
+
Layout=us
+
+
[Groups/0/Items/4]
+
Name=mozc
Layout=us
[GroupOrder]