hascheme/test.sh
Yann Esposito (Yogsototh) 7e377e2a32 adding test system
2013-07-17 22:25:48 +02:00

17 lines
382 B
Bash
Executable file

#!/usr/bin/env zsh
for fic in tests/*.in; do
input="${fic:r}"
arg="$(cat $input.in)"
print -n -- "$input: "
runghc y.hs "$arg" > $input.res
if diff $input.res $input.out > /dev/null; then
print -- "OK"
else
print -- "ERROR"
print -- " expected: '$(cat $input.out)'"
print -- " got: '$(cat $input.res)'"
print -- ""
fi
\rm -f $input.res
done