Testing update with check.sh
This commit is contained in:
27
check.sh
Executable file
27
check.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Diff-Check Tool #
|
||||
# Checks if outputed TOK = exp #
|
||||
# The Translators - Spring 2025 #
|
||||
|
||||
TOK_DIR="out"
|
||||
|
||||
if [[ ! -d "$TOK_DIR" ]]; then
|
||||
echo "Directory $TOK_DIR does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\n"
|
||||
for file in "$TOK_DIR"/*; do
|
||||
filename=$(basename -- "$file")
|
||||
filename="${filename%.*}"
|
||||
num=${filename:2:1}
|
||||
exp="./tests/sprint$num/expected/$filename.expected"
|
||||
|
||||
if [[ -f "$exp" ]]; then
|
||||
echo -e "--------------------------------------------"
|
||||
echo -e "Checking $file...\n"
|
||||
diff --color=always "$file" "$exp"
|
||||
echo -e "--------------------------------------------\n"
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user