An Express-like HTTP router for Bash compatible with CGI 1.1
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
533 B

_testPassCount=0
_testTotalCount=0
# $1: Message
# $2: Subshell output
function it() {
local exitCode=$?
local message="$1"
local output="$2"
local status
_testTotalCount=$((_testTotalCount+1))
if [ "$exitCode" -eq 0 ]; then
status='✓'
_testPassCount=$((_testPassCount+1))
else
status='✗'
fi
if [ -n "$output" ]; then
printf '%s\n' "$output"
fi
printf '%s %s\n' "$status" "$message"
}
function testSummary() {
printf 'Passed: %s of %s tests\n' "$_testPassCount" "$_testTotalCount"
}