nix-community.nixvim/tests/extend.nix

28 lines
647 B
Nix
Raw Normal View History

{
makeNixvimWithModule,
runCommandNoCCLocal,
}:
2024-05-05 19:39:35 +02:00
let
firstStage = makeNixvimWithModule {
module = {
extraConfigLua = "-- first stage";
};
};
secondStage = firstStage.extend { extraConfigLua = "-- second stage"; };
generated = secondStage.extend { extraConfigLua = "-- third stage"; };
in
runCommandNoCCLocal "extend-test" { printConfig = "${generated}/bin/nixvim-print-init"; } ''
2024-05-05 19:39:35 +02:00
config=$($printConfig)
for stage in "first" "second" "third"; do
if ! "$printConfig" | grep -q -- "-- $stage stage"; then
echo "Missing $stage stage in config"
echo "$config"
exit 1
fi
done
2024-05-05 19:39:35 +02:00
touch $out
''