From f894612ddeaa8fea346d9527bad9363cca92bf6e Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 15 Aug 2014 22:23:32 -0400 Subject: tests/common.sh: assert(): New function --- (limited to 'tests') 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 +} -- cgit v0.9.1