test(joker-num): fix permissions issues

ensure stop on first failure in a more compatible way (even if more basic)
This commit is contained in:
Michele Sessa 2023-03-27 17:08:32 +01:00 committed by Michele
parent 0ae6ee7fec
commit 52cdb0286e
1 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
IFS='
'
script_dirS=$(cd -P "$(dirname "$BASH_SOURCE")" &>/dev/null && pwd)
@ -10,16 +9,20 @@ challenge() {
input="${@: -1}"
submitted=$(
./student/joker-num.sh $args <<EOF
bash ./student/joker-num.sh $args <<EOF
$input
EOF
)
expected=$(
./solutions/joker-num.sh $args <<EOF
bash ./solutions/joker-num.sh $args <<EOF
$input
EOF
)
diff <(echo "$submitted") <(echo "$expected")
if [ $? != 0 ]
then
exit 1
fi
}
# Good input, win