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.

23 lines
512 B

#!/usr/bin/env bash
# Unofficial Bash Strict Mode
set -euo pipefail
IFS='
'
script_dirS=$(cd -P "$(dirname "$BASH_SOURCE")" &>/dev/null && pwd)
challenge() {
submitted=$(bash "$script_dirS"/student/comparator.sh $1 $2)
expected=$(bash "$script_dirS"/solutions/comparator.sh $1 $2)
diff <(echo "$submitted") <(echo "$expected")
}
for i in $(seq 1 10); do
n1=$(shuf -i 1-20 -n 1)
n2=$(shuf -i 1-30 -n 1)
challenge $n1 $n2
done
challenge "0" "0"
challenge "10" "10"
challenge "-11" "-11"