From 1b8c0aaea979fbf7cec40a93fdecc9f909411814 Mon Sep 17 00:00:00 2001 From: hugogogo Date: Tue, 14 Dec 2021 23:14:53 +0100 Subject: [PATCH] ne propose pas les logs si tests reussis --- tests/defaults/heredocs.sh | 8 +++----- unitests.sh | 10 +++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) 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