File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 56
56
for INFILE in " ${INFILES[@]} " ; do
57
57
if [ -t 1 ]; then echo -e " ${BOLDBLUE} Test ${INFILE: 8} ${ENDCOLOR} "
58
58
echo -e " ${BOLDBLUE} ---------- ${ENDCOLOR} "
59
- else echo -e " Test $INFILE \n---------- " ; fi
59
+ else echo -e " Test ${ INFILE: 8} \n---------- " ; fi
60
60
OUTFILE=" ${INFILE% .* } .out"
61
61
if [ ! -f " $OUTFILE " ]; then
62
62
echo -e " Test file $OUTFILE not found!\n"
63
63
continue
64
64
else
65
- DIF=" $( diff " $OUTFILE " <( ./a.out < " $INFILE " ) ) "
65
+ OUTPUT=$( ./a.out < " $INFILE " )
66
+ DIF=" $( diff " $OUTFILE " <( echo " $OUTPUT " ) ) "
67
+ EXPECTED=$( cat " $OUTFILE " )
66
68
if [ -n " $DIF " ]; then
67
- if [ -t 1 ]; then echo -e " ${RED} Test failed.${ENDCOLOR}
68
- \nDifference : ${RED} $DIF ${ENDCOLOR} \n"
69
- else echo -e " FAILED.\nDifference : $DIF \n" ; fi
69
+ if [ -t 1 ]; then echo -e " ${RED} Test failed.${ENDCOLOR} "
70
+ echo -e " Expected:\n\t${GREEN} $EXPECTED ${ENDCOLOR} "
71
+ echo -e " Actual:\n\t${RED} $OUTPUT ${ENDCOLOR} \n"
72
+ else echo -e " Test failed.\nExpected:\n\t$EXPECTED "
73
+ echo -e " Actual:\n\t$OUTPUT \n" ; fi
70
74
else
71
75
if [ -t 1 ]; then echo -e " ${GREEN} PASSED!${ENDCOLOR} \n"
72
76
else echo -e " PASSED!\n" ; fi
You can’t perform that action at this time.
0 commit comments