2024-05-13 21:24:10 +00:00
|
|
|
{ lib, writeShellScript }:
|
|
|
|
let output = "hello";
|
2024-05-02 00:46:19 +00:00
|
|
|
in (writeShellScript "test-script" ''
|
|
|
|
echo ${lib.escapeShellArg output}
|
|
|
|
'').overrideAttrs (old: {
|
|
|
|
checkPhase = old.checkPhase or "" + ''
|
|
|
|
expected=${lib.escapeShellArg output}
|
|
|
|
got=$("$target")
|
|
|
|
if [[ "$got" != "$expected" ]]; then
|
|
|
|
echo "wrong output: expected $expected, got $got"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
})
|