diff options
author | P. 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) |
commit | f894612ddeaa8fea346d9527bad9363cca92bf6e (patch) | |
tree | 48a6e1fba42166595a5fde2bc037b591483636de | |
parent | 9553d14fd8f080af04deeb634ba6e67681740470 (diff) |
tests/common.sh: assert(): New function
-rw-r--r-- | tests/common.sh | 8 |
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 +} |