diff --git a/maybe b/maybe index df0155f..972cd36 100755 --- a/maybe +++ b/maybe @@ -5,9 +5,12 @@ declare -A colors=( [yellow]=$(tput setaf 3) [reset]=$(tput sgr0) ) +success() { + printf '%s%s%s\n' "${colors[green]}" "$1" "${colors[reset]}" +} + for num in {1..1000}; do - printf '%s[>] Test %d/1000... ✓ passed.%s\n' "${colors[green]}" "$num" "${colors[reset]}" + success "[>] Test $num/1000... ✓ passed." done -printf '%sAll tests successful!%s\n' "${colors[green]}" "${colors[reset]}" -return 0 +success 'All tests successful!'