cleanup tests

This commit is contained in:
Dylan Araps 2018-06-15 10:17:17 +10:00
parent 9ba26572cb
commit 6119fc7b20
1 changed files with 4 additions and 6 deletions

10
test.sh
View File

@ -121,20 +121,18 @@ test_date() {
}
assert_equals() {
local status
((tests+=1))
[[ "$1" == "$2" ]] && status="✔"
printf '%s\n' " ${status:-} | ${FUNCNAME[1]/test_}"
if [[ "$1" == "$2" ]]; then
((pass+=1))
return 0
status=$'\e[32m✔'
else
:>/tmp/err
((err+=1))
return 1
status=$'\e[31m✖'
fi
printf ' %s\e[m | %s\n' "$status" "${FUNCNAME[1]/test_}"
}
main() {