mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 10:12:25 -05:00
86f50aa74e
There's no guarantee that the last executed command will have a zero exit code, and so the shell exit code may or may not be zero, even if all the tests pass. Also changes the `test || echo fail && exit` to `if not test { echo fail && exit }`, since that's nicer-looking.
19 lines
604 B
Bash
19 lines
604 B
Bash
#!/bin/sh
|
|
|
|
source test-commons.inc
|
|
|
|
# `head -n 1` should close stdout of the `Shell -c` command, which means the
|
|
# second echo should exit unsuccessfully and sigpipe.sh.out should not be
|
|
# created.
|
|
rm -f sigpipe.sh.out
|
|
|
|
{ echo foo && echo bar && echo baz > sigpipe.sh.out } | head -n 1 > /dev/null
|
|
|
|
# Failing commands don't make the test fail, just an explicit `exit 1` does.
|
|
# So the test only fails if sigpipe.sh.out exists (since then `exit 1` runs),
|
|
# not if the `test` statement returns false.
|
|
if test -e sigpipe.sh.out {
|
|
fail sigpipe did not terminate further commands
|
|
} else {
|
|
echo PASS
|
|
}
|