Automatic add

This commit is contained in:
cubernetes 2023-05-11 13:26:44 +02:00
parent 2be935a043
commit 1279d64327
1 changed files with 1 additions and 1 deletions

View File

@ -28,13 +28,13 @@ fi
catch stout sterr "${tmp_out}" catch stout sterr "${tmp_out}"
printf "%s\n" "Testing ${SRC}" printf "%s\n" "Testing ${SRC}"
printf "Expected Output --> Test Output\n"
diff_out="$(diff --expand-tabs --left-column --width="60" --side-by-side --label="Expected Output" --label=" Test Output" -- <(printf '%s\n' "${sterr}") <(printf '%s\n' "${stout}") && printf '%s\n' "0" || printf '%s\n' "1")" diff_out="$(diff --expand-tabs --left-column --width="60" --side-by-side --label="Expected Output" --label=" Test Output" -- <(printf '%s\n' "${sterr}") <(printf '%s\n' "${stout}") && printf '%s\n' "0" || printf '%s\n' "1")"
if [ "$(printf '%s' "${diff_out}" | tail -1)" = "0" ]; then if [ "$(printf '%s' "${diff_out}" | tail -1)" = "0" ]; then
printf "\e[102;30m%s\e[m\n" "All tests passed" printf "\e[102;30m%s\e[m\n" "All tests passed"
exit_status="0" exit_status="0"
else else
printf "Expected Output --> Test Output\n"
printf '%s' "${diff_out}" | head -n -1 printf '%s' "${diff_out}" | head -n -1
printf "\e[101;37m%s\e[m\n" "At least one test failed" printf "\e[101;37m%s\e[m\n" "At least one test failed"
exit_status="1" exit_status="1"