bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

parse-duration tests: Fix test failure on mingw


From: Bruno Haible
Subject: parse-duration tests: Fix test failure on mingw
Date: Thu, 20 Apr 2023 18:52:50 +0200

On mingw 10, I see this test failure:

FAIL: test-parse-duration.sh
============================

../../gltests/test-parse-duration.sh: line 64: test: 38898367
: integer expression expected
test-parse-duration fatal error:  38898367
 is not 38898367
FAIL test-parse-duration.sh (exit status: 1)

The cause is that there's a CR at the end of the tested output.

This patch fixes it.


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

        parse-duration tests: Fix test failure on mingw.
        * tests/test-parse-duration.sh: Transform CRLF to LF in the output,
        before analyzing the output.

diff --git a/tests/test-parse-duration.sh b/tests/test-parse-duration.sh
index e8be5ecb7e..cf45913261 100755
--- a/tests/test-parse-duration.sh
+++ b/tests/test-parse-duration.sh
@@ -60,7 +60,8 @@ cat > "${tmpf}" <<- _EOF_
 exec 3< "${tmpf}"
 while read line <&3
 do
-    v=`${CHECKER} ${exe} "${line}"` || { ls -l "${tmpf}"; die "Failed: ${exe} 
'${line}'"; }
+    v=`${CHECKER} ${exe} "${line}" | LC_ALL=C tr -d '\r'` \
+      || { ls -l "${tmpf}"; die "Failed: ${exe} '${line}'"; }
     test $v -eq 38898367 || die $v is not 38898367
 done
 exec 3>&-






reply via email to

[Prev in Thread] Current Thread [Next in Thread]