summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-09-09 15:22:55 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-09-09 15:22:55 (EDT)
commitf79a55cb6f646262008b1eeea7daca8e4fa00063 (patch)
tree2f3aeaf9d9c55f886a4751d8bf1fc46cca48a2ca
parent98b18decf9dac47adaccfcd1cb89d0420e5349ee (diff)
Fix test_assert.
-rw-r--r--tests/common.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/common.sh b/tests/common.sh
index 991566f..c32b3a1 100644
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -45,8 +45,10 @@ ob_use()
test_assert()
{
- if ! $(eval "${@}"); then
+ eval "${*}"
+ es="${?}"
+ if [ "${es}" -ne 0 ]; then
printf 'Assertion failed with exit status %d:\n %s\n' \
- "${?}" "${@}"
+ "${es}" "${*}"
fi
}