mirror of
https://github.com/dylanaraps/pure-bash-bible.git
synced 2025-09-08 22:21:26 +02:00
cleanup tests
This commit is contained in:
10
test.sh
10
test.sh
@@ -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() {
|
||||
|
Reference in New Issue
Block a user