Loading pkgs/test/replace-vars/default.nix +34 −22 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ let inherit (testers) testEqualContents testBuildFailure; mkTests = callReplaceVars: callReplaceVars: mkExpectation: lib.recurseIntoAttrs { succeeds = testEqualContents { assertion = "replaceVars-succeeds"; Loading @@ -21,13 +21,15 @@ let brotherhood = "shared humanity"; }; expected = builtins.toFile "expected" '' expected = mkExpectation ( builtins.toFile "source.txt" '' All human beings are born free and are the same in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of shared humanity. -- eroosevelt@humanrights.un.org ''; '' ); }; # There might eventually be a usecase for this, but it's not supported at the moment. Loading Loading @@ -83,13 +85,15 @@ let brotherhood = null; }; expected = builtins.toFile "expected" '' expected = mkExpectation ( builtins.toFile "source.txt" '' All human beings are born free and are the same in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of @brotherhood@. -- eroosevelt@humanrights.un.org ''; '' ); }; fails-in-check-phase-with-exemption = Loading Loading @@ -120,13 +124,21 @@ let }; in { replaceVars = mkTests replaceVars; replaceVarsWith = mkTests ( replaceVars = mkTests replaceVars lib.id; replaceVarsWith = mkTests ( src: replacements: replaceVarsWith { inherit src replacements; dir = "bin"; isExecutable = true; } ) ( file: runCommand "expected" { inherit file; } '' install -Dm755 "$file" "$out/bin/$(stripHash "$file")" '' ); } Loading
pkgs/test/replace-vars/default.nix +34 −22 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ let inherit (testers) testEqualContents testBuildFailure; mkTests = callReplaceVars: callReplaceVars: mkExpectation: lib.recurseIntoAttrs { succeeds = testEqualContents { assertion = "replaceVars-succeeds"; Loading @@ -21,13 +21,15 @@ let brotherhood = "shared humanity"; }; expected = builtins.toFile "expected" '' expected = mkExpectation ( builtins.toFile "source.txt" '' All human beings are born free and are the same in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of shared humanity. -- eroosevelt@humanrights.un.org ''; '' ); }; # There might eventually be a usecase for this, but it's not supported at the moment. Loading Loading @@ -83,13 +85,15 @@ let brotherhood = null; }; expected = builtins.toFile "expected" '' expected = mkExpectation ( builtins.toFile "source.txt" '' All human beings are born free and are the same in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of @brotherhood@. -- eroosevelt@humanrights.un.org ''; '' ); }; fails-in-check-phase-with-exemption = Loading Loading @@ -120,13 +124,21 @@ let }; in { replaceVars = mkTests replaceVars; replaceVarsWith = mkTests ( replaceVars = mkTests replaceVars lib.id; replaceVarsWith = mkTests ( src: replacements: replaceVarsWith { inherit src replacements; dir = "bin"; isExecutable = true; } ) ( file: runCommand "expected" { inherit file; } '' install -Dm755 "$file" "$out/bin/$(stripHash "$file")" '' ); }