5 nix-build -A tests.trivial-builders.writeShellScriptBin
8 { lib, writeScriptBin, runCommand }:
11 pkg = writeScriptBin "test-script" ''
12 echo ${lib.escapeShellArg output}
15 assert pkg.meta.mainProgram == "test-script";
16 runCommand "test-writeScriptBin" { } ''
18 echo Testing with getExe...
20 target=${lib.getExe pkg}
21 expected=${lib.escapeShellArg output}
23 if [[ "$got" != "$expected" ]]; then
24 echo "wrong output: expected $expected, got $got"
28 echo Testing with makeBinPath...
30 PATH="${lib.makeBinPath [ pkg ]}:$PATH"
32 if [[ "$got" != "$expected" ]]; then
33 echo "wrong output: expected $expected, got $got"