1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
summary: shell is tricky
details: |
Shell can be surprisingly tricky. This test captures some of the things
we've learned and now guard against. The test is expected to pass all the
time, it simply contains "executable documentation" that is meant to
illustrate how non-obvious some behavior is.
# 1: increment if you had to read this or edit this
execute: |
# NOTE: Disable set -e that was implicitly provided by spread and check for
# errors explicitly. This allows us to to be verify the exit code of each
# test *without* falling into one of the traps of shell negation.
set +e
./set-e-pipe-chain-with-negation.sh
test $? -eq 0 || exit 1
./set-e-pipe-chain-with-not.sh
test $? -eq 1 || exit 1
./set-e-simple-cmd-with-negation.sh
test $? -eq 0 || exit 1
./set-e-simple-cmd-with-not.sh
test $? -eq 1 || exit 1
|