5 nix-build -A tests.trivial-builders.writeShellScriptBin
15 pkg = writeShellScriptBin "test-script" ''
16 echo ${lib.escapeShellArg output}
19 assert pkg.meta.mainProgram == "test-script";
20 runCommand "test-writeShellScriptBin" { } ''
22 echo Testing with getExe...
24 target=${lib.getExe pkg}
25 expected=${lib.escapeShellArg output}
27 if [[ "$got" != "$expected" ]]; then
28 echo "wrong output: expected $expected, got $got"
32 echo Testing with makeBinPath...
34 PATH="${lib.makeBinPath [ pkg ]}:$PATH"
36 if [[ "$got" != "$expected" ]]; then
37 echo "wrong output: expected $expected, got $got"