Avoid top-level `with ...;` in pkgs/build-support/writers/test.nix

authored by philiptaron.tngl.sh and committed by Valentin Gagarin efb603b2 c4d42034

+37 -7
+37 -7
pkgs/build-support/writers/test.nix
··· 11 11 12 12 # If you are reading this, you can test these writers by running: nix-build . -A tests.writers 13 13 14 - with writers; 15 14 let 15 + inherit (lib) getExe recurseIntoAttrs; 16 + 17 + inherit (writers) 18 + makeFSharpWriter 19 + writeBash 20 + writeBashBin 21 + writeDash 22 + writeDashBin 23 + writeFish 24 + writeFishBin 25 + writeFSharp 26 + writeHaskell 27 + writeHaskellBin 28 + writeJS 29 + writeJSBin 30 + writeJSON 31 + writeLua 32 + writeNu 33 + writePerl 34 + writePerlBin 35 + writePyPy3 36 + writePython3 37 + writePython3Bin 38 + writeRuby 39 + writeRust 40 + writeRustBin 41 + writeText 42 + writeTOML 43 + writeYAML 44 + ; 45 + 16 46 expectSuccess = test: 17 47 runCommand "run-${test.name}" {} '' 18 48 if [[ "$(${test})" != success ]]; then ··· 25 55 26 56 expectSuccessBin = test: 27 57 runCommand "run-${test.name}" {} '' 28 - if [[ "$(${lib.getExe test})" != success ]]; then 58 + if [[ "$(${getExe test})" != success ]]; then 29 59 echo 'test ${test.name} failed' 30 60 exit 1 31 61 fi ··· 39 69 in 40 70 testers.testEqualContents { expected = expectedFile; actual = file; assertion = "${file.name} matches"; }; 41 71 in 42 - lib.recurseIntoAttrs { 43 - bin = lib.recurseIntoAttrs { 72 + recurseIntoAttrs { 73 + bin = recurseIntoAttrs { 44 74 bash = expectSuccessBin (writeBashBin "test-writers-bash-bin" '' 45 75 if [[ "test" == "test" ]]; then echo "success"; fi 46 76 ''); ··· 140 170 #''); 141 171 }; 142 172 143 - simple = lib.recurseIntoAttrs { 173 + simple = recurseIntoAttrs { 144 174 bash = expectSuccess (writeBash "test-writers-bash" '' 145 175 if [[ "test" == "test" ]]; then echo "success"; fi 146 176 ''); ··· 265 295 ''); 266 296 }; 267 297 268 - path = lib.recurseIntoAttrs { 298 + path = recurseIntoAttrs { 269 299 bash = expectSuccess (writeBash "test-writers-bash-path" (writeText "test" '' 270 300 if [[ "test" == "test" ]]; then echo "success"; fi 271 301 '')); ··· 306 336 }; 307 337 }; 308 338 309 - wrapping = lib.recurseIntoAttrs { 339 + wrapping = recurseIntoAttrs { 310 340 bash-bin = expectSuccessBin ( 311 341 writeBashBin "test-writers-wrapping-bash-bin" 312 342 {