From 82751669c22885d81016142265ec6fbe6efd11f1 Mon Sep 17 00:00:00 2001 From: eslopfer Date: Mon, 9 Jan 2023 07:30:29 +0000 Subject: [PATCH] test(division: add check for test command) --- sh/tests/division_test.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sh/tests/division_test.sh b/sh/tests/division_test.sh index 23ba0ab0..93450513 100755 --- a/sh/tests/division_test.sh +++ b/sh/tests/division_test.sh @@ -8,6 +8,14 @@ IFS=' script_dirS=$(cd -P "$(dirname "$BASH_SOURCE")" &>/dev/null && pwd) challenge() { + # Test if test command was used + if grep -q "test" "$script_dirS"/student/division.sh + then + echo "Error: the test command cannot be used in the student script" + return + fi + + # Test with one or two arguments if [ $# -eq 1 ] then submitted=$(bash "$script_dirS"/student/division.sh $1)