tests: Test neovim properly

This seems to work.
This commit is contained in:
Donovan Glover 2024-05-12 21:59:35 -04:00
parent d1f759441a
commit 240cf74584
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -1,4 +1,3 @@
# TODO: Ensure that neovim config works without errors on startup
let
inherit (builtins) attrValues;
in
@ -12,7 +11,35 @@ in
};
testScript = /* python */ ''
output = machine.succeed("echo 'Hello world'")
assert "Hello world" in output
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(5)
machine.send_chars("i")
machine.sleep(1)
machine.send_chars("Hello world")
machine.sleep(1)
machine.send_key("esc")
machine.sleep(1)
machine.send_chars(":wq")
machine.sleep(1)
machine.send_key("ret")
machine.sleep(1)
text = machine.succeed("cat /home/user/hello.txt")
assert "Hello world" in text
'';
}