Browse Source

fix(to-git-or-not-to-git): add check for echo

pull/2023/head
miguel 2 years ago committed by MSilva95
parent
commit
bb59c2fedf
  1. 4
      sh/tests/to-git-or-not-to-git_test.sh

4
sh/tests/to-git-or-not-to-git_test.sh

@ -11,6 +11,10 @@ FILENAME="student/to-git-or-not-to-git.sh"
if [ -f ${FILENAME} ]; then if [ -f ${FILENAME} ]; then
# FILE exists and it's not empty # FILE exists and it's not empty
if [ -s ${FILENAME} ]; then 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) submitted=$(bash $FILENAME)
expected=$(bash solutions/to-git-or-not-to-git.sh) expected=$(bash solutions/to-git-or-not-to-git.sh)
diff <(echo "$submitted") <(echo "$expected") diff <(echo "$submitted") <(echo "$expected")

Loading…
Cancel
Save