mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-23 00:34:24 +01:00
e077bb8ff4
The addition of the neovim plugins made the initial time to open longer than 5 seconds and thus failed the tests. Note that using an alternative method like machine.wait_for_text() is probably better in the long run to avoid flaky tests.
54 lines
1.1 KiB
Nix
54 lines
1.1 KiB
Nix
let
|
|
inherit (builtins) attrValues;
|
|
in
|
|
(import ../lib/test.nix) {
|
|
name = "neovim";
|
|
|
|
nodes.machine = { nix-config, ... }: {
|
|
imports = attrValues {
|
|
inherit (nix-config.nixosModules) desktop system shell;
|
|
|
|
customConfig = {
|
|
modules.desktop.container = true;
|
|
};
|
|
};
|
|
|
|
home-manager.sharedModules = attrValues {
|
|
inherit (nix-config.homeManagerModules) neovim;
|
|
};
|
|
};
|
|
|
|
testScript = /* python */ ''
|
|
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")
|
|
machine.sleep(20)
|
|
|
|
machine.send_chars("i")
|
|
machine.sleep(2)
|
|
machine.send_chars("Hello world")
|
|
machine.sleep(2)
|
|
machine.send_key("esc")
|
|
machine.sleep(2)
|
|
machine.send_chars(":wq")
|
|
machine.sleep(2)
|
|
machine.send_key("ret")
|
|
machine.sleep(2)
|
|
|
|
text = machine.succeed("cat /home/user/hello.txt")
|
|
|
|
assert "Hello world" in text
|
|
'';
|
|
}
|