mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-14 03:04:34 +02:00
tests: test the tests
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.
This commit is contained in:
parent
eac092c876
commit
60ea38d2c4
2 changed files with 27 additions and 0 deletions
|
@ -25,6 +25,11 @@
|
|||
inherit (self.lib.${system}.check) mkTestDerivationFromNixvimModule;
|
||||
};
|
||||
|
||||
failing-tests = import ../tests/failing-tests.nix {
|
||||
inherit pkgs;
|
||||
inherit (self.lib.${system}.check) mkTestDerivationFromNixvimModule;
|
||||
};
|
||||
|
||||
no-flake = import ../tests/no-flake.nix {
|
||||
inherit system;
|
||||
inherit (self.lib.${system}.check) mkTestDerivationFromNvim;
|
||||
|
|
22
tests/failing-tests.nix
Normal file
22
tests/failing-tests.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
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
|
||||
''
|
Loading…
Add table
Add a link
Reference in a new issue