diff --git a/tests/asserts.nix b/tests/asserts.nix index 6d1b1002..c1fe177e 100644 --- a/tests/asserts.nix +++ b/tests/asserts.nix @@ -37,37 +37,45 @@ with lib; }; }; - config = mkIf config.test.asserts.warnings.enable { - home.file = { - "asserts/warnings.actual".text = concatStringsSep '' + config = mkMerge [ + (mkIf config.test.asserts.warnings.enable { + 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 = '' - assertFileContent \ - home-files/asserts/warnings.actual \ - ${ - pkgs.writeText "warnings.expected" (concatStringsSep '' + (mkIf config.test.asserts.assertions.enable { + home.file = { + "asserts/assertions.actual".text = concatStringsSep '' - -- - '' config.test.asserts.warnings.expected) - } + -- + '' (map (x: x.message) (filter (x: !x.assertion) config.assertions)); + }; - assertFileContent \ - home-files/asserts/assertions.actual \ - ${ - pkgs.writeText "assertions.expected" (concatStringsSep '' + nmt.script = '' + assertFileContent \ + home-files/asserts/assertions.actual \ + ${ + pkgs.writeText "assertions.expected" (concatStringsSep '' - -- - '' config.test.asserts.assertions.expected) - } - ''; - }; + -- + '' config.test.asserts.assertions.expected) + } + ''; + }) + ]; }