This commit is contained in:
2024-02-19 11:21:07 +01:00
parent de0377397f
commit e8dfb94860
34 changed files with 295 additions and 38 deletions

28
test.sh Normal file
View File

@ -0,0 +1,28 @@
#! /usr/bin/bash
for f in ./tests/*.plthy; do
filename=$(basename $f .plthy)
python ./plthy -i "tests/$filename.plthy" > "tests/$filename.output"
printf '%-20s' "${filename/_/" "} "
if test -f "tests/$filename.expected1"; then
match_found=0
for g in ./tests/$filename.expected*; do
if cmp -s "$g" "tests/$filename.output"; then
echo "✓"
match_found=1
break
fi
done
if [ $match_found -eq 0 ]; then
echo "X"
fi
else
if cmp -s "tests/$filename.expected" "tests/$filename.output"; then
echo "✓"
else
echo "X"
fi
fi
done