Browse Source

test(json-researcher): check echo is used

DEV-4017-prototypes-exercise-1-animals
Zouhair AMAZZAL 2 years ago committed by Zouhair AMAZZAL
parent
commit
0dea7a8945
  1. 4
      sh/tests/json-researcher_test.sh

4
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")

Loading…
Cancel
Save