Skip to content

Commit 1320f96

Browse files
committed
💲
1 parent 0570419 commit 1320f96

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ctest.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ for INFILE in "${INFILES[@]}"; do
9494
OUTPUT=$(./a.out < "$INFILE")
9595
# compare the output with the expected output
9696
DIF="$(diff -Z "$OUTFILE" <(echo "$OUTPUT"))"
97+
# print DIF
98+
echo -e "$DIF"
9799
if [ -n "$DIF" ]; then
98100
# test failed
99101
if [ -t 1 ]; then echo -e $(red "Test failed.")
@@ -117,7 +119,7 @@ for INFILE in "${INFILES[@]}"; do
117119
echo -e "\n line "$OUT""
118120
fi
119121
done
120-
while [[ $GOT -ne $EXP ]]; do
122+
while [[ $GOT -ne $EXP ]] && read -r line; do
121123
# get next > lines until they match the number of < lines
122124
read -r line
123125
if [[ $line == ">"* ]]; then

0 commit comments

Comments
 (0)