Skip to content

Commit

Permalink
πŸ‘€
Browse files Browse the repository at this point in the history
  • Loading branch information
lslvr committed Mar 9, 2021
1 parent ac4c3f9 commit d099c12
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tbd
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ shopt -s expand_aliases; alias null='> /dev/null 2> "${__err_t:=$(mktemp)}" ' \
trace='2> "${__err_t:=$(mktemp)}" ' \
status='printf "\r\e[%sm %s\e[m\n"'

@ () { printf "\n\e[1m-- ${*}\e[m\n"; }
trap 'rm -f "$__err_t"; printf "\n\e[3m ${__tt:-0} tests, ${__ok:-0} passed, ${__no:-0} failed.\e[m\n\n"' \
EXIT


@ () { printf "\n\e[1;33m-- ${*}\e[m\n"; }

- () {
((__tt++)); printf "%4s'${1}' ${*:2}"
((__tt++)); printf "%4s${1} \e[34m${2} \e[m${*:3}"

case "$2" in ( works ) null eval "$1";;
( fails ) null eval "! $1";;
Expand All @@ -18,7 +22,4 @@ shopt -s expand_aliases; alias null='> /dev/null 2> "${__err_t:=$(mktemp)}" ' \
( * ) ((__no++)); status 31 "!!"; sed 's/^/ | /' "$__err_t"; exit 1;; esac
}

trap 'rm -f "$__err_t"; printf "\n\e[3m ${__tt:-0} tests, ${__ok:-0} passed, ${__no:-0} failed.\e[m\n\n"' \
EXIT

for _ in "${@:-testfile}"; do source "$_"; done

0 comments on commit d099c12

Please sign in to comment.