Introduce assert_failure
This commit is contained in:
parent
1a10b24b06
commit
f9d6696687
2 changed files with 26 additions and 1 deletions
|
|
@ -46,7 +46,13 @@ assert_success() {
|
|||
exit 1
|
||||
fi
|
||||
}
|
||||
export -f run assert_success
|
||||
assert_failure() {
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "Expected command to fail, but it succeeded."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
export -f run assert_success assert_failure
|
||||
|
||||
# main flow
|
||||
orig_ref="$(git symbolic-ref --quiet --short HEAD || git rev-parse HEAD)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue