2024-04-05 15:02:00 +02:00
|
|
|
let
|
|
|
|
inherit (builtins) attrValues;
|
2024-04-05 17:26:22 +02:00
|
|
|
in
|
2024-04-09 14:02:16 +02:00
|
|
|
(import ../lib/test.nix) {
|
2024-04-02 11:15:15 +02:00
|
|
|
name = "neovim";
|
|
|
|
|
2024-04-05 17:50:28 +02:00
|
|
|
nodes.machine = { nix-config, ... }: {
|
2024-04-05 15:02:00 +02:00
|
|
|
imports = attrValues {
|
2024-05-19 05:56:31 +02:00
|
|
|
inherit (nix-config.nixosModules) desktop system shell;
|
|
|
|
|
|
|
|
customConfig = {
|
|
|
|
modules.desktop.container = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
home-manager.sharedModules = attrValues {
|
2024-07-19 01:41:23 +02:00
|
|
|
inherit (nix-config.homeModules) neovim;
|
2024-04-05 15:02:00 +02:00
|
|
|
};
|
2024-04-02 11:15:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = /* python */ ''
|
2024-05-13 03:59:35 +02:00
|
|
|
machine.wait_for_unit("default.target")
|
|
|
|
|
|
|
|
machine.send_chars("user")
|
|
|
|
machine.sleep(1)
|
|
|
|
machine.send_key("ret")
|
|
|
|
machine.sleep(1)
|
|
|
|
machine.send_chars("user")
|
|
|
|
machine.sleep(1)
|
|
|
|
machine.send_key("ret")
|
|
|
|
machine.sleep(5)
|
|
|
|
|
|
|
|
machine.send_chars("nvim hello.txt")
|
|
|
|
machine.sleep(1)
|
|
|
|
machine.send_key("ret")
|
2024-05-20 19:37:33 +02:00
|
|
|
machine.sleep(20)
|
2024-05-13 03:59:35 +02:00
|
|
|
|
|
|
|
machine.send_chars("i")
|
2024-05-20 19:37:33 +02:00
|
|
|
machine.sleep(2)
|
2024-05-13 03:59:35 +02:00
|
|
|
machine.send_chars("Hello world")
|
2024-05-20 19:37:33 +02:00
|
|
|
machine.sleep(2)
|
2024-05-13 03:59:35 +02:00
|
|
|
machine.send_key("esc")
|
2024-05-20 19:37:33 +02:00
|
|
|
machine.sleep(2)
|
2024-05-13 03:59:35 +02:00
|
|
|
machine.send_chars(":wq")
|
2024-05-20 19:37:33 +02:00
|
|
|
machine.sleep(2)
|
2024-05-13 03:59:35 +02:00
|
|
|
machine.send_key("ret")
|
2024-05-20 19:37:33 +02:00
|
|
|
machine.sleep(2)
|
2024-05-13 03:59:35 +02:00
|
|
|
|
|
|
|
text = machine.succeed("cat /home/user/hello.txt")
|
|
|
|
|
|
|
|
assert "Hello world" in text
|
2024-04-02 11:15:15 +02:00
|
|
|
'';
|
|
|
|
}
|