On mingw 10, I see this test failure:

FAIL: test-readtokens.sh
========================

--- exp 2023-04-20 06:20:32.200323300 +0200
+++ out 2023-04-20 06:20:32.232259800 +0200
@@ -1 +1 @@
-a:b:c:
+a:b:c:
--- exp 2023-04-20 06:20:32.278874900 +0200
+++ out 2023-04-20 06:20:32.310364100 +0200
@@ -1 +1 @@
-a:b:c:
+a:b:c:
--- exp 2023-04-20 06:20:32.341123600 +0200
+++ out 2023-04-20 06:20:32.373390600 +0200
@@ -1 +1 @@
-a:b:c:
+a:b:c:
FAIL test-readtokens.sh (exit status: 1)

The cause is a CRLF end-of-line in the actual output. This patch fixes it.


2023-04-20  Bruno Haible  <br...@clisp.org>

        readtokens tests: Fix test failure on mingw.
        * tests/test-readtokens.sh: Transform CRLF to LF in the output, before
        comparing with the expected output.

diff --git a/tests/test-readtokens.sh b/tests/test-readtokens.sh
index 4c7821ff7e..d0af2590a6 100755
--- a/tests/test-readtokens.sh
+++ b/tests/test-readtokens.sh
@@ -7,17 +7,20 @@ ${CHECKER} test-readtokens || fail=1
 
 # Simplest case.
 echo a:b:c: > exp || fail=1
-printf a:b:c | ${CHECKER} test-readtokens : > out 2>&1 || fail=1
+printf a:b:c | ${CHECKER} test-readtokens : > tmp 2>&1 || fail=1
+LC_ALL=C tr -d '\r' < tmp > out || fail=1
 compare exp out || fail=1
 
 # Use NUL as the delimiter.
 echo a:b:c: > exp || fail=1
-printf 'a\0b\0c' | ${CHECKER} test-readtokens '\0' > out 2>&1 || fail=1
+printf 'a\0b\0c' | ${CHECKER} test-readtokens '\0' > tmp 2>&1 || fail=1
+LC_ALL=C tr -d '\r' < tmp > out || fail=1
 compare exp out || fail=1
 
 # Two delimiter bytes, and adjacent delimiters in the input.
 echo a:b:c: > exp || fail=1
-printf a:-:b-:c:: | ${CHECKER} test-readtokens :- > out 2>&1 || fail=1
+printf a:-:b-:c:: | ${CHECKER} test-readtokens :- > tmp 2>&1 || fail=1
+LC_ALL=C tr -d '\r' < tmp > out || fail=1
 compare exp out || fail=1
 
 Exit $fail




Reply via email to