From d2d9d9f00535875766ce8f8c725eeeb9b7f1cdb1 Mon Sep 17 00:00:00 2001 From: "Matthieu C." <886074+teto@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:25:08 +0200 Subject: [PATCH] neovim.tests: add a test for passthru.initRc --- pkgs/applications/editors/neovim/tests/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/neovim/tests/default.nix b/pkgs/applications/editors/neovim/tests/default.nix index 14d682e14e43..a5443ab4896c 100644 --- a/pkgs/applications/editors/neovim/tests/default.nix +++ b/pkgs/applications/editors/neovim/tests/default.nix @@ -101,8 +101,18 @@ in ### neovim tests ################## nvim_with_plugins = wrapNeovim2 "-with-plugins" nvimConfNix; + nvim_singlelines = wrapNeovim2 "-single-lines" nvimConfSingleLines; - singlelinesconfig = runTest (wrapNeovim2 "-single-lines" nvimConfSingleLines) '' + # test that passthru.initRc hasn't changed + passthruInitRc = runTest nvim_singlelines '' + INITRC=${pkgs.writeTextFile { name = "initrc"; text = nvim_singlelines.passthru.initRc; }} + assertFileContent \ + $INITRC \ + "${./init-single-lines.vim}" + ''; + + # test single line concatenation + singlelinesconfig = runTest nvim_singlelines '' assertFileContains \ "$luarcGeneric" \ "vim.cmd.source \"/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-init.vim" @@ -127,6 +137,7 @@ in viAlias = true; }; + # test it still works with vim-plug nvim_with_plug = neovim.override { extraName = "-with-plug"; configure.packages.plugins = with pkgs.vimPlugins; {