`assert` added to test runner

monad
Mike Gerwitz 2014-06-14 00:34:25 -04:00
parent a073da42f8
commit 3ddf7f00e8
1 changed files with 16 additions and 0 deletions

View File

@ -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"