mirror of
https://github.com/dylanaraps/pure-bash-bible.git
synced 2025-09-09 22:51:16 +02:00
cleanup tests
This commit is contained in:
10
test.sh
10
test.sh
@@ -121,20 +121,18 @@ test_date() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert_equals() {
|
assert_equals() {
|
||||||
local status
|
|
||||||
((tests+=1))
|
((tests+=1))
|
||||||
|
|
||||||
[[ "$1" == "$2" ]] && status="✔"
|
|
||||||
printf '%s\n' " ${status:-✖} | ${FUNCNAME[1]/test_}"
|
|
||||||
|
|
||||||
if [[ "$1" == "$2" ]]; then
|
if [[ "$1" == "$2" ]]; then
|
||||||
((pass+=1))
|
((pass+=1))
|
||||||
return 0
|
status=$'\e[32m✔'
|
||||||
else
|
else
|
||||||
:>/tmp/err
|
:>/tmp/err
|
||||||
((err+=1))
|
((err+=1))
|
||||||
return 1
|
status=$'\e[31m✖'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
printf ' %s\e[m | %s\n' "$status" "${FUNCNAME[1]/test_}"
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
Reference in New Issue
Block a user