tests: fix test.assert.assertions.enable not working

Co-authored-by: Robert Helgesson <robert@rycee.net>
This commit is contained in:
Thiago Kenji Okada 2021-10-08 21:10:35 -03:00 committed by Robert Helgesson
parent 4fa1ba72a3
commit b78b584368
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -37,37 +37,45 @@ with lib;
}; };
}; };
config = mkIf config.test.asserts.warnings.enable { config = mkMerge [
home.file = { (mkIf config.test.asserts.warnings.enable {
"asserts/warnings.actual".text = concatStringsSep '' home.file = {
"asserts/warnings.actual".text = concatStringsSep ''
-- --
'' config.warnings; '' config.warnings;
};
"asserts/assertions.actual".text = concatStringsSep '' nmt.script = ''
assertFileContent \
home-files/asserts/warnings.actual \
${
pkgs.writeText "warnings.expected" (concatStringsSep ''
-- --
'' (map (x: x.message) (filter (x: !x.assertion) config.assertions)); '' config.test.asserts.warnings.expected)
}; }
'';
})
nmt.script = '' (mkIf config.test.asserts.assertions.enable {
assertFileContent \ home.file = {
home-files/asserts/warnings.actual \ "asserts/assertions.actual".text = concatStringsSep ''
${
pkgs.writeText "warnings.expected" (concatStringsSep ''
-- --
'' config.test.asserts.warnings.expected) '' (map (x: x.message) (filter (x: !x.assertion) config.assertions));
} };
assertFileContent \ nmt.script = ''
home-files/asserts/assertions.actual \ assertFileContent \
${ home-files/asserts/assertions.actual \
pkgs.writeText "assertions.expected" (concatStringsSep '' ${
pkgs.writeText "assertions.expected" (concatStringsSep ''
-- --
'' config.test.asserts.assertions.expected) '' config.test.asserts.assertions.expected)
} }
''; '';
}; })
];
} }