2023-01-09 17:13:36 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# set -euo pipefail
|
|
|
|
IFS='
|
|
|
|
'
|
|
|
|
|
|
|
|
script_dirS=$(cd -P "$(dirname "$BASH_SOURCE")" &>/dev/null && pwd)
|
|
|
|
|
|
|
|
challenge() {
|
|
|
|
submitted="./check-user.sh $@
|
|
|
|
"
|
|
|
|
expected="./check-user.sh $@
|
|
|
|
"
|
2023-01-11 12:01:36 +00:00
|
|
|
submitted+=$(bash 2>&1 "$script_dirS"/student/check-user.sh "$@")
|
|
|
|
expected+=$(bash 2>&1 "$script_dirS"/solutions/check-user.sh "$@")
|
2023-01-09 17:13:36 +00:00
|
|
|
|
|
|
|
diff -U 1 <(echo "$submitted") <(echo "$expected")
|
|
|
|
}
|
|
|
|
|
|
|
|
challenge "-i" "root"
|
|
|
|
challenge "-e" "root"
|
|
|
|
|
|
|
|
challenge "-i" "unknown_not_found"
|
|
|
|
challenge "-e" "unknown_not_found"
|
|
|
|
|
|
|
|
challenge
|
|
|
|
challenge "-i" "root" "too" "many" "args"
|
|
|
|
challenge "-t" "root"
|