diff --git a/test/run-test b/test/run-test index d8e4873..1528f56 100755 --- a/test/run-test +++ b/test/run-test @@ -29,6 +29,22 @@ cd "$( dirname "$0" )/../" || { } +## +# Provide command to output assertion on failure +# +# We do not override the `test` builtin, as this would also affect pkgsh +# itself. +# +assert() +{ + test "$@" || { + local -i code=$? + echo "assertion failed: $@" >&2 + return $code + } +} + + main() { local tpath="$1"