This commit is contained in:
Timo Schmidt 2023-05-03 22:03:14 +02:00
parent 7a2087ad14
commit c9c036bf84
3 changed files with 5 additions and 4 deletions

View File

@ -15,6 +15,7 @@ if [ ! "${?}" = "0" ] || [ ! -f "${tmp_out}" ]; then
fi
printf "%s\n" "Testing ${SRC}"
printf "Expected | Success\n"
diff --expand-tabs --left-column --width="60" --side-by-side --label="Expected Output" --label=" Test Output" -- <("${tmp_out}" 2>&1 1>/dev/null) <("${tmp_out}" 2>/dev/null) && { printf "\e[102;30m%s\e[m\n" "All tests passed"; exit_status="0"; } || { printf "\e[101;37m%s\e[m\n" "At least one test failed"; exit_status="1"; }
rm -f -- "${tmp_out}"
@ -53,8 +54,6 @@ exit -- "${exit_status}"
int ft_isalpha(int c);
int main(){
test( "Test output", printf, "\n");
expect("Expected output", printf, "\n");
test( "'a'", printf, "%d\n", ft_isalpha('a'));
expect( "'a'", printf, "%d\n", isalpha('a'));
test( "'A'", printf, "%d\n", ft_isalpha('A'));

View File

@ -15,6 +15,7 @@ if [ ! "${?}" = "0" ] || [ ! -f "${tmp_out}" ]; then
fi
printf "%s\n" "Testing ${SRC}"
printf "Expected | Success\n"
diff --expand-tabs --left-column --width="60" --side-by-side --label="Expected Output" --label=" Test Output" -- <("${tmp_out}" 2>&1 1>/dev/null) <("${tmp_out}" 2>/dev/null) && { printf "\e[102;30m%s\e[m\n" "All tests passed"; exit_status="0"; } || { printf "\e[101;37m%s\e[m\n" "At least one test failed"; exit_status="1"; }
rm -f -- "${tmp_out}"

View File

@ -15,6 +15,7 @@ if [ ! "${?}" = "0" ] || [ ! -f "${tmp_out}" ]; then
fi
printf "%s\n" "Testing ${SRC}"
printf "Expected | Success\n"
diff --expand-tabs --left-column --width="60" --side-by-side --label="Expected Output" --label=" Test Output" -- <("${tmp_out}" 2>&1 1>/dev/null) <("${tmp_out}" 2>/dev/null) && { printf "\e[102;30m%s\e[m\n" "All tests passed"; exit_status="0"; } || { printf "\e[101;37m%s\e[m\n" "At least one test failed"; exit_status="1"; }
rm -f -- "${tmp_out}"
@ -51,7 +52,7 @@ exit -- "${exit_status}"
#include <ctype.h>
int main(){
test( "Test output", printf, "\n");
expect("Expected output", printf, "\n");
// test( "Test output", printf, "\n");
// expect("Expected output", printf, "\n");
return 0;
}