nix-community.nixvim/tests/extra-args.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
969 B
Nix
Raw Permalink Normal View History

{
makeNixvimWithModule,
runCommandLocal,
}:
let
defaultModule =
{ regularArg, ... }:
{
extraConfigLua = ''
-- regularArg=${regularArg}
'';
};
generated = makeNixvimWithModule {
2024-05-05 19:39:35 +02:00
module =
{ regularArg, extraModule, ... }:
2024-05-05 19:39:35 +02:00
{
_module.args = {
regularArg = "regularValue";
2024-05-05 19:39:35 +02:00
};
imports = [
defaultModule
extraModule
2024-05-05 19:39:35 +02:00
];
};
extraSpecialArgs = {
extraModule = {
extraConfigLua = ''
-- specialArg=specialValue
'';
};
};
};
in
runCommandLocal "special-arg-test" { printConfig = "${generated}/bin/nixvim-print-init"; } ''
config=$($printConfig)
if ! "$printConfig" | grep -- '-- regularArg=regularValue'; then
echo "Missing regularArg in config"
exit 1
fi
if ! "$printConfig" | grep -- '-- specialArg=specialValue'; then
echo "Missing specialArg in config"
exit 1
fi
touch $out
''