From 0dea7a8945156f4e1e4144e160144c6b5cbd02e2 Mon Sep 17 00:00:00 2001 From: Zouhair AMAZZAL Date: Wed, 7 Dec 2022 14:52:13 +0100 Subject: [PATCH] test(json-researcher): check echo is used --- sh/tests/json-researcher_test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sh/tests/json-researcher_test.sh b/sh/tests/json-researcher_test.sh index 20957d1c6..6e11f783c 100755 --- a/sh/tests/json-researcher_test.sh +++ b/sh/tests/json-researcher_test.sh @@ -11,6 +11,10 @@ FILENAME="student/json-researcher.sh" if [ -f ${FILENAME} ]; then # FILE exists and it's not empty if [ -s ${FILENAME} ]; then + if [[ $(cat $FILENAME | grep echo | wc -l) -ne 0 ]]; then + echo "echo is not allowed in this exercise!"; + exit 1 + fi submitted=$(bash $FILENAME) expected=$(bash solutions/json-researcher.sh) diff <(echo "$submitted") <(echo "$expected")