diff --git a/sh/tests/solutions/teacher.sh b/sh/tests/solutions/teacher.sh index d50961733..42295d49b 100755 --- a/sh/tests/solutions/teacher.sh +++ b/sh/tests/solutions/teacher.sh @@ -1,13 +1,7 @@ #!/usr/bin/env bash -PWD=$(pwd) - -for folder in $PWD -do - cd "$folder" || exit - INTERVIEWNUMBER=$(head -n 179 streets/Buckingham_Place | tail -n 1 | cut -d "#" -f2) - echo "$INTERVIEWNUMBER" - cat interviews/interview-"$INTERVIEWNUMBER" - grep -A 4 L337 vehicles | grep -A 3 -B 1 Honda | grep -A 2 -B 2 Blue | grep -B 4 "Height: 6" - cat memberships/AAA memberships/Delta_SkyMiles memberships/Museum_of_Bash_History memberships/Terminal_City_Library| grep "$MAIN_SUSPECT" | wc -l -done +INTERVIEWNUMBER=$(head -n 179 streets/Buckingham_Place | tail -n 1 | cut -d "#" -f2) +echo "$INTERVIEWNUMBER" +cat interviews/interview-"$INTERVIEWNUMBER" +grep -A 4 L337 vehicles | grep -A 3 -B 1 Honda | grep -A 2 -B 2 Blue | grep -B 4 "Height: 6" +cat memberships/AAA memberships/Delta_SkyMiles memberships/Museum_of_Bash_History memberships/Terminal_City_Library| grep "$MAIN_SUSPECT" | wc -l diff --git a/sh/tests/teacher_test.sh b/sh/tests/teacher_test.sh index 584ceda12..0e9de9c5a 100755 --- a/sh/tests/teacher_test.sh +++ b/sh/tests/teacher_test.sh @@ -9,7 +9,7 @@ script_dirS=$(cd -P "$(dirname "$BASH_SOURCE")" &>/dev/null && pwd) challenge() { - submitted=$(cd "$1" && "$script_dirS"/student/teacher.sh) + submitted=$(cd "$1" && "$script_dirS"/student/teacher.sh) || (echo "Your program crashed (non-zero status code)"; exit 1) expected=$(cd "$1" && "$script_dirS"/solutions/teacher.sh) if ! diff -q <(echo "$submitted") <(echo "$expected") &>/dev/null; then