diff --git a/tests/defaults/heredocs.sh b/tests/defaults/heredocs.sh index 69e931f..c78dd61 100644 --- a/tests/defaults/heredocs.sh +++ b/tests/defaults/heredocs.sh @@ -1,6 +1,4 @@ -#!/bin/bash - -#cat << EOF -#hello -#EOF +cat << EOF +hello +EOF diff --git a/unitests.sh b/unitests.sh index dd10d79..15ecb41 100644 --- a/unitests.sh +++ b/unitests.sh @@ -225,10 +225,14 @@ DEFAULT_DIR="./tests/defaults/" # ask to show the diff # -rsn1 will stop read after first key pressed - read -rsn1 -p 'if you want to see the diff, press "y"' DIFF - if [[ "${DIFF,,}" == y ]] + + if [ $TOTAL_SUCCESS -lt $TOTAL_TEST ] then - diff -y --width=100 --color=always "$BASH_LOG" "$MINISHELL_LOG" + read -rsn1 -p 'if you want to see the diff, press "y"' DIFF + if [[ "${DIFF,,}" == y ]] + then + diff -y --width=100 --color=always "$BASH_LOG" "$MINISHELL_LOG" + fi fi # delete files created during tests