Skip to content

Commit

Permalink
Test scripts compare text files as text, without stripping newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Jan 28, 2025
1 parent b5d6ef3 commit 35c2cf0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/asm/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RGBASM=../../rgbasm
RGBLINK=../../rgblink

tryDiff () {
if ! diff -u --strip-trailing-cr "$1" "$2"; then
if ! diff -au "$1" "$2"; then
echo "${bold}${red}${i%.asm}${variant}.$3 mismatch!${rescolors}${resbold}"
false
fi
Expand Down
2 changes: 1 addition & 1 deletion test/fix/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rescolors="$(tput op)"
RGBFIX=./rgbfix

tryDiff () {
if ! diff -u --strip-trailing-cr "$1" "$2"; then
if ! diff -au "$1" "$2"; then
echo "${bold}${red}${3:-$1} mismatch!${rescolors}${resbold}"
false
fi
Expand Down
4 changes: 2 additions & 2 deletions test/gfx/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ for f in *.png; do
newTest "$RGBGFX" $flags "$f"
if [[ -e "${f%.png}.err" ]]; then
runTest 2>"$errtmp"
diff -u --strip-trailing-cr "${f%.png}.err" "$errtmp" || failTest
diff -au "${f%.png}.err" "$errtmp" || failTest
else
runTest && checkOutput "${f%.png}" || failTest $?
fi

newTest "$RGBGFX" $flags - "<$f"
if [[ -e "${f%.png}.err" ]]; then
runTest 2>"$errtmp"
diff -u --strip-trailing-cr <(sed "s/$f/<stdin>/g" "${f%.png}.err") "$errtmp" || failTest
diff -au <(sed "s/$f/<stdin>/g" "${f%.png}.err") "$errtmp" || failTest
else
runTest && checkOutput "${f%.png}" || failTest $?
fi
Expand Down
2 changes: 1 addition & 1 deletion test/link/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ continueTest () {
}

tryDiff () {
if ! diff -u --strip-trailing-cr "$1" "$2"; then
if ! diff -au "$1" "$2"; then
echo "${bold}${red}$1 mismatch!${rescolors}${resbold}"
false
fi
Expand Down

0 comments on commit 35c2cf0

Please sign in to comment.