You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
759 B

#!/usr/bin/env bash
# Unofficial Bash Strict Mode
set -euo pipefail
IFS='
'
script_dirS=$(cd -P "$(dirname "$BASH_SOURCE")" &>/dev/null && pwd)
challenge() {
if [ $# -eq 1 ]
then
submitted=$(bash "$script_dirS"/student/division.sh $1)
expected=$(bash "$script_dirS"/solutions/division.sh $1)
else
submitted=$(bash "$script_dirS"/student/division.sh $1 $2)
expected=$(bash "$script_dirS"/solutions/division.sh $1 $2)
fi
diff <(echo "$submitted") <(echo "$expected")
}
challenge "10" "2"
challenge "4" "2"
challenge "0.5" "0.5"
challenge "5" "2"
challenge "0.5"
challenge "foo" "bar"
challenge "1" "0"
challenge "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" "2"