|
11 | 11 | inherit (testers) testEqualContents testBuildFailure; |
12 | 12 |
|
13 | 13 | mkTests = |
14 | | - callReplaceVars: |
| 14 | + callReplaceVars: mkExpectation: |
15 | 15 | lib.recurseIntoAttrs { |
16 | 16 | succeeds = testEqualContents { |
17 | 17 | assertion = "replaceVars-succeeds"; |
|
21 | 21 | brotherhood = "shared humanity"; |
22 | 22 | }; |
23 | 23 |
|
24 | | - expected = builtins.toFile "expected" '' |
25 | | - All human beings are born free and are the same in dignity and rights. |
26 | | - They are endowed with reason and conscience and should act towards |
27 | | - one another in a spirit of shared humanity. |
| 24 | + expected = mkExpectation ( |
| 25 | + builtins.toFile "source.txt" '' |
| 26 | + All human beings are born free and are the same in dignity and rights. |
| 27 | + They are endowed with reason and conscience and should act towards |
| 28 | + one another in a spirit of shared humanity. |
28 | 29 |
|
29 | | - |
30 | | - ''; |
| 30 | + |
| 31 | + '' |
| 32 | + ); |
31 | 33 | }; |
32 | 34 |
|
33 | 35 | # There might eventually be a usecase for this, but it's not supported at the moment. |
|
83 | 85 | brotherhood = null; |
84 | 86 | }; |
85 | 87 |
|
86 | | - expected = builtins.toFile "expected" '' |
87 | | - All human beings are born free and are the same in dignity and rights. |
88 | | - They are endowed with reason and conscience and should act towards |
89 | | - one another in a spirit of @brotherhood@. |
| 88 | + expected = mkExpectation ( |
| 89 | + builtins.toFile "source.txt" '' |
| 90 | + All human beings are born free and are the same in dignity and rights. |
| 91 | + They are endowed with reason and conscience and should act towards |
| 92 | + one another in a spirit of @brotherhood@. |
90 | 93 |
|
91 | | - |
92 | | - ''; |
| 94 | + |
| 95 | + '' |
| 96 | + ); |
93 | 97 | }; |
94 | 98 |
|
95 | 99 | fails-in-check-phase-with-exemption = |
@@ -120,13 +124,21 @@ let |
120 | 124 | }; |
121 | 125 | in |
122 | 126 | { |
123 | | - replaceVars = mkTests replaceVars; |
124 | | - replaceVarsWith = mkTests ( |
125 | | - src: replacements: |
126 | | - replaceVarsWith { |
127 | | - inherit src replacements; |
128 | | - dir = "bin"; |
129 | | - isExecutable = true; |
130 | | - } |
131 | | - ); |
| 127 | + replaceVars = mkTests replaceVars lib.id; |
| 128 | + replaceVarsWith = |
| 129 | + mkTests |
| 130 | + ( |
| 131 | + src: replacements: |
| 132 | + replaceVarsWith { |
| 133 | + inherit src replacements; |
| 134 | + dir = "bin"; |
| 135 | + isExecutable = true; |
| 136 | + } |
| 137 | + ) |
| 138 | + ( |
| 139 | + file: |
| 140 | + runCommand "expected" { inherit file; } '' |
| 141 | + install -Dm755 "$file" "$out/bin/$(stripHash "$file")" |
| 142 | + '' |
| 143 | + ); |
132 | 144 | } |
0 commit comments