tests: properly set exit code.

This commit is contained in:
Dylan Araps 2018-05-18 14:28:56 +10:00
parent 3b57104997
commit 5fb3ab6ee3
2 changed files with 4 additions and 0 deletions

View file

@ -32,6 +32,9 @@ test_get_process_name() {
printf "%s\\n" "Test MISC functions." printf "%s\\n" "Test MISC functions."
test_convert_time test_convert_time
test_get_ppid test_get_ppid
test_get_process_name test_get_process_name
[[ -f /tmp/err ]] || exit 0 && { rm /tmp/err; exit 1; }

View file

@ -7,4 +7,5 @@ assert_equals() {
local status local status
[[ "$1" == "$2" ]] && status="✔" [[ "$1" == "$2" ]] && status="✔"
printf "%s\\n" " ${status:-} : ${FUNCNAME[1]}" printf "%s\\n" " ${status:-} : ${FUNCNAME[1]}"
[[ "$1" == "$2" ]] || { :>/tmp/err; return 1; } && return 0
} }