>From 16cd53b1c01cc6af9056735f83dcdd1e68491e0f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 25 Sep 2020 19:00:53 -0700 Subject: [PATCH] regex-tests: fix possible Turkish false-alarm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * modules/regex-tests (Depends-on): Add wctype-h. * tests/test-regex.c: Include wctype.h. (main): Check that ‘i’ uppercases to ‘İ’ in Turkish, as the Turkish regex test assumes this. --- ChangeLog | 6 ++++++ modules/regex-tests | 1 + tests/test-regex.c | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3ef9570e1..259f788f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2020-09-25 Paul Eggert + regex-tests: fix possible Turkish false-alarm + * modules/regex-tests (Depends-on): Add wctype-h. + * tests/test-regex.c: Include wctype.h. + (main): Check that ‘i’ uppercases to ‘İ’ in Turkish, + as the Turkish regex test assumes this. + regex-tests: fix test and add debug output Perhaps this will fix the recent grep test failure reported at: https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/199 diff --git a/modules/regex-tests b/modules/regex-tests index 711632aa0..4b14f4724 100644 --- a/modules/regex-tests +++ b/modules/regex-tests @@ -5,6 +5,7 @@ tests/macros.h Depends-on: gettext-h localcharset +wctype-h configure.ac: diff --git a/tests/test-regex.c b/tests/test-regex.c index 96def52f5..a54f643d8 100644 --- a/tests/test-regex.c +++ b/tests/test-regex.c @@ -24,6 +24,7 @@ #include #include #include +#include #if HAVE_DECL_ALARM # include # include @@ -141,7 +142,8 @@ main (void) return 1; } - if (setlocale (LC_ALL, "tr_TR.UTF-8") && really_utf8 ()) + if (setlocale (LC_ALL, "tr_TR.UTF-8") && really_utf8 () + && towupper (L'i') == 0x0130 /* U+0130; see below. */) { re_set_syntax (RE_SYNTAX_GREP | RE_ICASE); memset (®ex, 0, sizeof regex); -- 2.17.1