mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
24 lines
879 B
YAML
24 lines
879 B
YAML
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
|
|
|