1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 11:36:07 +01:00
nixvim/tests/extra-args.nix
Matt Sturgeon fe059cd395 flake: add nixf-diagnose to treefmt config
Checks nixd's diagnostic lints using libnixf.
2025-10-01 00:42:40 +00:00

46 lines
957 B
Nix

{
makeNixvimWithModule,
runCommandLocal,
}:
let
defaultModule =
{ regularArg, ... }:
{
extraConfigLua = ''
-- regularArg=${regularArg}
'';
};
generated = makeNixvimWithModule {
module =
{ extraModule, ... }:
{
_module.args = {
regularArg = "regularValue";
};
imports = [
defaultModule
extraModule
];
};
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
''