Browse Source

Fix teacher test

pull/779/head
xpetit 4 years ago
parent
commit
97dcdafc99
No known key found for this signature in database
GPG Key ID: 97C60669182C17A5
  1. 16
      sh/tests/solutions/teacher.sh
  2. 2
      sh/tests/teacher_test.sh

16
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

2
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

Loading…
Cancel
Save