neovim: test pure lua dependencies (#8991)
a revert of https://github.com/nix-community/home-manager/pull/8959 since we now relies on nixpkgs wrapper for that. adding a test to avoid regressions. Choosing telescope as starting point is https://github.com/nix-community/home-manager/issues/8787 I find the nmt test setup lacking: it doesnt set $PATH or $HOME (nvim will error when it can't write into $HOME).
This commit is contained in:
parent
1ce9e62690
commit
f21d8ebbc9
2 changed files with 18 additions and 4 deletions
|
|
@ -441,8 +441,8 @@ in
|
|||
withNodeJs = cfg.withNodeJs || cfg.coc.enable;
|
||||
plugins = nixpkgsCompatiblePlugins;
|
||||
|
||||
extraLuaPackages = lp: cfg.extraLuaPackages lp ++ vimPackageInfo.luaDependencies;
|
||||
inherit (cfg)
|
||||
extraLuaPackages
|
||||
extraName
|
||||
withPython3
|
||||
withRuby
|
||||
|
|
@ -521,7 +521,6 @@ in
|
|||
''
|
||||
else
|
||||
null;
|
||||
|
||||
in
|
||||
lib.mkMerge [
|
||||
(lib.mkIf wrapperHasUserConfig (
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ lib.mkIf config.test.enableBig {
|
|||
# to test passthru.initLua is taken into account
|
||||
plugin = unicode-vim;
|
||||
}
|
||||
{
|
||||
# test pure lua dependencies: telescope relies on the lua version of plenary
|
||||
plugin = telescope-nvim;
|
||||
}
|
||||
];
|
||||
extraLuaPackages = ps: [ ps.luautf8 ];
|
||||
};
|
||||
|
|
@ -48,15 +52,26 @@ lib.mkIf config.test.enableBig {
|
|||
in
|
||||
''
|
||||
vimout=$(mktemp)
|
||||
|
||||
export PATH="$TESTED/home-path/bin:$PATH"
|
||||
export HOME=$TMPDIR/hm-user
|
||||
initLua="$TESTED/home-files/.config/nvim/init.lua"
|
||||
|
||||
echo "redir >> /dev/stdout | echo g:hmExtraConfig | echo g:hmPlugins | echo g:Unicode_data_directory | redir END" \
|
||||
| ${pkgs.neovim}/bin/nvim -es -u "$TESTED/home-files/.config/nvim/init.lua" \
|
||||
| nvim -es -i NONE -u "$initLua" \
|
||||
> "$vimout" || true
|
||||
|
||||
assertFileContains "$vimout" "HM_EXTRA_CONFIG"
|
||||
assertFileContains "$vimout" "HM_PLUGINS_CONFIG"
|
||||
# testing that unicode-vim's value is echoed
|
||||
assertFileContains "$vimout" "autoload/unicode"
|
||||
|
||||
initLua="$TESTED/home-files/.config/nvim/init.lua"
|
||||
# check telescope can find plenary/does not trigger any error
|
||||
if ! nvim -V3log.txt -i NONE -es -u "$initLua" -c "lua require('plenary') " -c "quit"; then
|
||||
fail "Could not require the 'plenary' dependency pulled by telescope.nvim"
|
||||
cat log.txt
|
||||
fi
|
||||
|
||||
assertFileContent $(normalizeStorePaths "$initLua") ${./plugin-config.expected}
|
||||
|
||||
# Verify generatedConfigs evaluated properly (issue #8371)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue