From 240cf745848aede7087cbc9c61561d469d68da0e Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sun, 12 May 2024 21:59:35 -0400 Subject: [PATCH] tests: Test neovim properly This seems to work. --- tests/neovim.nix | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/tests/neovim.nix b/tests/neovim.nix index 3bf5f849..3ab8bd83 100644 --- a/tests/neovim.nix +++ b/tests/neovim.nix @@ -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 ''; }