]> Savannah Git Hosting - gnulib.git/commitdiff
regex-tests: fix possible Turkish false-alarm
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Sep 2020 02:00:53 +0000 (19:00 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Sep 2020 02:01:32 +0000 (19:01 -0700)
* 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
modules/regex-tests
tests/test-regex.c

index 3ef9570e10eb840b709ef930c9ca140494f1e66c..259f788f36403c6062277706af3766a2c109d52e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2020-09-25  Paul Eggert  <eggert@cs.ucla.edu>
 
+       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
index 711632aa06908f1ffd76fe5e77effb295238edf0..4b14f4724c68adcbf7ac91d6e3b656fc684fa129 100644 (file)
@@ -5,6 +5,7 @@ tests/macros.h
 Depends-on:
 gettext-h
 localcharset
+wctype-h
 
 configure.ac:
 
index 96def52f5971793e8aae0b1fc1c25f93c528db3d..a54f643d839779e71fc79062be7841edd559aa15 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <wctype.h>
 #if HAVE_DECL_ALARM
 # include <unistd.h>
 # include <signal.h>
@@ -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 (&regex, 0, sizeof regex);