mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
Adds a regression test for #2076. This test ensures that `extraConfigLua` is used in `finalPackage` and that the test will fail correctly when running `nvim` results in unexpected output.
22 lines
488 B
Nix
22 lines
488 B
Nix
{
|
|
pkgs,
|
|
mkTestDerivationFromNixvimModule,
|
|
}:
|
|
let
|
|
inherit (pkgs.testers) testBuildFailure;
|
|
|
|
failed = testBuildFailure (mkTestDerivationFromNixvimModule {
|
|
name = "prints-hello-world";
|
|
module = {
|
|
extraConfigLua = ''
|
|
print('Hello, world!')
|
|
'';
|
|
};
|
|
inherit pkgs;
|
|
});
|
|
in
|
|
pkgs.runCommand "failing-test" { inherit failed; } ''
|
|
grep -F 'Hello, world!' "$failed/testBuildFailure.log"
|
|
[[ 1 = $(cat "$failed/testBuildFailure.exit") ]]
|
|
touch $out
|
|
''
|