summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-15 22:23:32 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-15 22:23:32 (EDT)
commitf894612ddeaa8fea346d9527bad9363cca92bf6e (patch)
tree48a6e1fba42166595a5fde2bc037b591483636de /tests
parent9553d14fd8f080af04deeb634ba6e67681740470 (diff)
tests/common.sh: assert(): New function
Diffstat (limited to 'tests')
-rw-r--r--tests/common.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/common.sh b/tests/common.sh
index cd90eb8..93f8d53 100644
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -47,3 +47,11 @@ use()
exit 2
fi
}
+
+assert()
+{
+ if ! eval "${@}"; then
+ warn 'Assertion failed: %s\n' "${*}"
+ tests_es=1
+ fi
+}