diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-12-16 14:39:18 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-12-16 15:06:25 -0500 |
commit | 7d87b96b421b76e387cee903b7b7c1bc16c54310 (patch) | |
tree | e5c90a458a1418578cf31fd80301f6f99ab96251 /tests/tests.sh | |
parent | e01042b84abdfa224d47e6d11eb9798ce4c7d2f8 (diff) | |
download | bfs-7d87b96b421b76e387cee903b7b7c1bc16c54310.tar.xz |
tests: Move crash detection into invoke_bfs, use ! instead of fail
Diffstat (limited to 'tests/tests.sh')
-rwxr-xr-x | tests/tests.sh | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/tests.sh b/tests/tests.sh index 3047bf4..844de5c 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -476,19 +476,13 @@ function bfs_verbose() { function invoke_bfs() { bfs_verbose "$@" "${BFS[@]}" "$@" -} - -# Expect a command to fail, but not crash -function fail() { - "$@" - local STATUS="$?" + local status=$? - if ((STATUS > 125)); then - exit "$STATUS" - elif ((STATUS > 0)); then - return 0 + # Allow bfs to fail, but not crash + if ((status > 125)); then + exit $status else - return 1 + return $status fi } |