From 4aeef1941f862fe3a70d1b8264b4e289358c2325 Mon Sep 17 00:00:00 2001 From: teto <886074+teto@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:40:41 +0100 Subject: [PATCH] neovim: update tests to work with latest nixpkgs Since https://github.com/NixOS/nixpkgs/pull/495392, the wrapper doesn't create provider executables along with the neovim wrapper. They still exist but at locations indicated by the g:XXX_provider_host variable. --- .../modules/programs/neovim/wrapper-args.nix | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/modules/programs/neovim/wrapper-args.nix b/tests/modules/programs/neovim/wrapper-args.nix index 6f2f63cb..637af2e0 100644 --- a/tests/modules/programs/neovim/wrapper-args.nix +++ b/tests/modules/programs/neovim/wrapper-args.nix @@ -55,9 +55,20 @@ in assertNeovimExpr() { local var_name="$1" local expected_pattern="$2" - if ! nvim -i NONE --headless --cmd "echo $var_name" +q! 2>&1 | grep "$expected_pattern" ; then - fail "Provider $var_name doesn't match expected pattern '$expected_pattern'" + local output=$(nvim -i NONE --headless --cmd "echo $var_name" +q! 2>&1) + local exit_code=$? + + if [ $exit_code -ne 0 ]; then + echo "neovim command failed with code: $exit_code and output:" + fail "$output" + elif ! grep "$expected_pattern" "$output" ; then + echo "Provider $var_name doesn't match expected pattern '$expected_pattern'" + echo "Output:" + fail "$output" fi + + # assuming we enabled all providers + assertFileExists "$output" } # Ensure the main binary exists @@ -67,20 +78,16 @@ in assertBinaryContains "$nvimBin" "-my-suffix/rplugin.vim" # 2. withPerl: Check if nvim-perl binary exists and host prog is set - assertFileExists "home-path/bin/nvim-perl" - assertNeovimExpr "g:perl_host_prog" "nvim-perl" + assertNeovimExpr "g:perl_host_prog" "perl" # 3. withPython3: Check if nvim-python3 binary exists and host prog is set - assertFileExists "home-path/bin/nvim-python3" assertNeovimExpr "g:python3_host_prog" "python3" # 4. withRuby: Check if nvim-ruby binary exists, GEM_HOME and host prog are set - assertFileExists "home-path/bin/nvim-ruby" assertBinaryContains "$nvimBin" "GEM_HOME=" assertNeovimExpr "g:ruby_host_prog" "ruby" # 5. withNodeJs: Check if nvim-node binary exists and host prog is set - assertFileExists "home-path/bin/nvim-node" assertNeovimExpr "g:node_host_prog" "node" # 6. waylandSupport: Check for wl-clipboard path in wrapper's PATH modification