Browse Source

docs(grades): fix test and error message

DEV-4397-piscine-ai-missing-file-for-ex-7-of-nlp
miguel 2 years ago committed by MSilva95
parent
commit
36f079db98
  1. 11
      sh/tests/grades_test.sh
  2. 2
      sh/tests/solutions/grades.sh
  3. 2
      subjects/devops/grades/README.md

11
sh/tests/grades_test.sh

@ -5,8 +5,9 @@ IFS='
script_dirS=$(cd -P "$(dirname "$BASH_SOURCE")" &>/dev/null && pwd)
challenge() {
args=$1
input=$2
input="${@: -1}"
args=${@:1:$#-1}
submitted=$(
bash -c ""$script_dirS"/student/grades.sh $args" <<EOF
@ -23,9 +24,8 @@ EOF
if [ $? != 0 ]; then
exit 1
fi
echo $submitted
echo $expected
}
challenge 1 "Student1
90
"
@ -83,3 +83,6 @@ not_good
challenge 1 "Student1
-75
"
challenge 1 1 "Louis
20
"

2
sh/tests/solutions/grades.sh

@ -4,7 +4,7 @@ num_students=$1
declare -a students
if [ $# -ne 1 ]; then
echo "Error: Expect 1 argument only!"
echo "Error: expect 1 argument only!"
exit 1
fi

2
subjects/devops/grades/README.md

@ -66,7 +66,7 @@ Student Name #1: Bob
Student Grade #1: ten
Error: The grade 'ten' is not a valid input. Only numerical grades between 0 and 100 are accepted.
$ ./grades.sh 1 2 3
Error: Expect 1 argument only!
Error: expect 1 argument only!
$
```

Loading…
Cancel
Save