Suggested by Paul Eggert.
* tests/test-dfa-invalid-char-class.sh: Revert last change.
* tests/test-dfa-match-aux.c: Include binary-io.h.
(main): Put stdout into binary mode.
* modules/dfa-tests (Depends-on): Add binary-io.
+2023-04-22 Bruno Haible <bruno@clisp.org>
+
+ dfa tests: Fix test failure on mingw differently.
+ Suggested by Paul Eggert.
+ * tests/test-dfa-invalid-char-class.sh: Revert last change.
+ * tests/test-dfa-match-aux.c: Include binary-io.h.
+ (main): Put stdout into binary mode.
+ * modules/dfa-tests (Depends-on): Add binary-io.
+
2023-04-20 Bruno Haible <bruno@clisp.org>
getumask: Make it work on native Windows.
tests/test-dfa-invalid-merge.sh
Depends-on:
+binary-io
stdio
stdlib
string
fail=0
echo 'dfaerror: invalid character class' > exp
-LC_ALL=C ${CHECKER} test-dfa-match-aux '[[:foo:]]' a > tmp 2>&1
-LC_ALL=C tr -d '\r' < tmp > out
+LC_ALL=C ${CHECKER} test-dfa-match-aux '[[:foo:]]' a > out 2>&1
compare exp out || fail=1
Exit $fail
#include <dfa.h>
#include <localeinfo.h>
+#include "binary-io.h"
+
_Noreturn void
dfaerror (char const *mesg)
{
if (argc < 3)
exit (EXIT_FAILURE);
+ /* This test's fixture needs to compare this program's output with an expected
+ output. On native Windows, the CR-LF newlines would cause this comparison
+ to fail. But we don't want to postprocess this program's output. */
+ set_binary_mode (STDOUT_FILENO, O_BINARY);
+
setlocale (LC_ALL, "");
init_localeinfo (&localeinfo);