]> Savannah Git Hosting - gnulib.git/commitdiff
fnmatch tests: Renumber tests.
authorBruno Haible <bruno@clisp.org>
Sat, 29 Jul 2023 20:50:44 +0000 (22:50 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 29 Jul 2023 23:41:00 +0000 (01:41 +0200)
* tests/test-fnmatch-w32-*.sh: Renamed 1 -> 2 -> 3 -> 5 -> 7 -> 4 -> 6 -> 8.
* tests/test-fnmatch-w32.c: Update.
* modules/fnmatch-tests: Update.

ChangeLog
modules/fnmatch-tests
tests/test-fnmatch-w32-1.sh [deleted file]
tests/test-fnmatch-w32-2.sh
tests/test-fnmatch-w32-3.sh
tests/test-fnmatch-w32-4.sh
tests/test-fnmatch-w32-5.sh
tests/test-fnmatch-w32-6.sh
tests/test-fnmatch-w32-7.sh
tests/test-fnmatch-w32-8.sh [new file with mode: 0755]
tests/test-fnmatch-w32.c

index adb9d8335202c4df6c967db22ba8317b10a28023..29b298d93187cfe200d390d5720332f4a57db538 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2023-07-29  Bruno Haible  <bruno@clisp.org>
 
+       fnmatch tests: Renumber tests.
+       * tests/test-fnmatch-w32-*.sh: Renamed 1 -> 2 -> 3 -> 5 -> 7 -> 4 -> 6
+       -> 8.
+       * tests/test-fnmatch-w32.c: Update.
+       * modules/fnmatch-tests: Update.
+
        c32stombs tests: Renumber tests.
        * tests/test-c32stombs-*.sh: Renamed 1 -> 2 -> 3 -> 4 -> 5.
        * tests/test-c32stombs.c: Update.
index 30ec4fded62582f77ce333de5373390dfb07a480..8dbb7330edd4861e6b92fa0df5fea8055d4b34d6 100644 (file)
@@ -5,13 +5,13 @@ tests/test-fnmatch-3.sh
 tests/test-fnmatch-4.sh
 tests/test-fnmatch-5.sh
 tests/test-fnmatch.c
-tests/test-fnmatch-w32-1.sh
 tests/test-fnmatch-w32-2.sh
 tests/test-fnmatch-w32-3.sh
 tests/test-fnmatch-w32-4.sh
 tests/test-fnmatch-w32-5.sh
 tests/test-fnmatch-w32-6.sh
 tests/test-fnmatch-w32-7.sh
+tests/test-fnmatch-w32-8.sh
 tests/test-fnmatch-w32.c
 tests/signature.h
 tests/macros.h
@@ -36,9 +36,9 @@ Makefile.am:
 TESTS += \
   test-fnmatch-1.sh test-fnmatch-2.sh test-fnmatch-3.sh test-fnmatch-4.sh \
   test-fnmatch-5.sh \
-  test-fnmatch-w32-1.sh test-fnmatch-w32-2.sh test-fnmatch-w32-3.sh \
-  test-fnmatch-w32-4.sh test-fnmatch-w32-5.sh test-fnmatch-w32-6.sh \
-  test-fnmatch-w32-7.sh
+  test-fnmatch-w32-2.sh test-fnmatch-w32-3.sh test-fnmatch-w32-4.sh \
+  test-fnmatch-w32-5.sh test-fnmatch-w32-6.sh test-fnmatch-w32-7.sh \
+  test-fnmatch-w32-8.sh
 TESTS_ENVIRONMENT += \
   LOCALE_FR='@LOCALE_FR@' \
   LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
diff --git a/tests/test-fnmatch-w32-1.sh b/tests/test-fnmatch-w32-1.sh
deleted file mode 100755 (executable)
index 6efe31f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# Test a CP1252 locale.
-${CHECKER} ./test-fnmatch-w32${EXEEXT} French_France 1252
index aacf62a3f71b71323bef92f4d871566c5ead9aca..6efe31fe9c0f1526dd169fd3ae42b61fe819a4bf 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-# Test a CP1256 locale.
-${CHECKER} ./test-fnmatch-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
+# Test a CP1252 locale.
+${CHECKER} ./test-fnmatch-w32${EXEEXT} French_France 1252
index 56c8ef1ae6b059d34df8c41eb17c7af5f058595c..aacf62a3f71b71323bef92f4d871566c5ead9aca 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-# Test a CP932 locale.
-${CHECKER} ./test-fnmatch-w32${EXEEXT} Japanese_Japan 932
+# Test a CP1256 locale.
+${CHECKER} ./test-fnmatch-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
index e3c518115d48ff692c61cf7414c08e3050091ab3..15f26faa9aac0496ecee67eedf8d27ab9f850f16 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-# Test a CP950 locale.
-${CHECKER} ./test-fnmatch-w32${EXEEXT} Chinese_Taiwan 950
+# Test some UTF-8 locales.
+${CHECKER} ./test-fnmatch-w32${EXEEXT} French_France Japanese_Japan Chinese_Taiwan Chinese_China 65001
index 0c2a048db27105c7234a9e1fcce6587f7c713e17..56c8ef1ae6b059d34df8c41eb17c7af5f058595c 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-# Test a CP936 locale.
-${CHECKER} ./test-fnmatch-w32${EXEEXT} Chinese_China 936
+# Test a CP932 locale.
+${CHECKER} ./test-fnmatch-w32${EXEEXT} Japanese_Japan 932
index af024428e66f3476734c53484e698b714ff87533..e3c518115d48ff692c61cf7414c08e3050091ab3 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-# Test a GB18030 locale.
-${CHECKER} ./test-fnmatch-w32${EXEEXT} Chinese_China 54936
+# Test a CP950 locale.
+${CHECKER} ./test-fnmatch-w32${EXEEXT} Chinese_Taiwan 950
index 15f26faa9aac0496ecee67eedf8d27ab9f850f16..0c2a048db27105c7234a9e1fcce6587f7c713e17 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-# Test some UTF-8 locales.
-${CHECKER} ./test-fnmatch-w32${EXEEXT} French_France Japanese_Japan Chinese_Taiwan Chinese_China 65001
+# Test a CP936 locale.
+${CHECKER} ./test-fnmatch-w32${EXEEXT} Chinese_China 936
diff --git a/tests/test-fnmatch-w32-8.sh b/tests/test-fnmatch-w32-8.sh
new file mode 100755 (executable)
index 0000000..af02442
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a GB18030 locale.
+${CHECKER} ./test-fnmatch-w32${EXEEXT} Chinese_China 54936
index 1eb280a2a0491d0dc245b5e53c93e47999af1d68..3768178375f34c29cccb3b0192ebca4b0558296b 100644 (file)
@@ -144,6 +144,88 @@ test_one_locale (const char *name, int codepage)
 
       return 0;
 
+    case 65001:
+      /* Locale encoding is CP65001 = UTF-8.  */
+      if (strcmp (locale_charset (), "UTF-8") != 0)
+        return 77;
+
+      ASSERT (fnmatch ("x?y", "x\303\274y", 0) == 0); /* "xüy" */
+      ASSERT (fnmatch ("x?y", "x\303\237y", 0) == 0); /* "xßy" */
+      ASSERT (fnmatch ("x?y", "x\360\237\230\213y", 0) == 0); /* "x😋y" */
+      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
+      ASSERT (fnmatch ("x[[:alnum:]]y", "x\305\201y", 0) == 0);
+      /* U+10330 GOTHIC LETTER AHSA */
+      ASSERT (fnmatch ("x[[:alnum:]]y", "x\360\220\214\260y", 0) == 0);
+      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
+      ASSERT (fnmatch ("x[[:alpha:]]y", "x\305\201y", 0) == 0);
+      /* U+10330 GOTHIC LETTER AHSA */
+      ASSERT (fnmatch ("x[[:alpha:]]y", "x\360\220\214\260y", 0) == 0);
+      /* U+00B8 CEDILLA */
+      ASSERT (fnmatch ("x[[:graph:]]y", "x\302\270y", 0) == 0);
+      /* U+20000 <CJK Ideograph> */
+      ASSERT (fnmatch ("x[[:graph:]]y", "x\360\240\200\200y", 0) == 0);
+      /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */
+      ASSERT (fnmatch ("x[[:lower:]]y", "x\303\277y", 0) == 0);
+      /* U+10441 DESERET SMALL LETTER EF */
+      ASSERT (fnmatch ("x[[:lower:]]y", "x\360\220\221\201y", 0) == 0);
+      /* U+00B8 CEDILLA */
+      ASSERT (fnmatch ("x[[:print:]]y", "x\302\270y", 0) == 0);
+      /* U+20000 <CJK Ideograph> */
+      ASSERT (fnmatch ("x[[:print:]]y", "x\360\240\200\200y", 0) == 0);
+      /* U+00BF INVERTED QUESTION MARK */
+      ASSERT (fnmatch ("x[[:punct:]]y", "x\302\277y", 0) == 0);
+      /* U+1D100 MUSICAL SYMBOL SINGLE BARLINE */
+      ASSERT (fnmatch ("x[[:punct:]]y", "x\360\235\204\200y", 0) == 0);
+      /* U+3000 IDEOGRAPHIC SPACE */
+      ASSERT (fnmatch ("x[[:space:]]y", "x\343\200\200y", 0) == 0);
+      /* U+0429 CYRILLIC CAPITAL LETTER SHCHA */
+      ASSERT (fnmatch ("x[[:upper:]]y", "x\320\251y", 0) == 0);
+      /* U+10419 DESERET CAPITAL LETTER EF */
+      ASSERT (fnmatch ("x[[:upper:]]y", "x\360\220\220\231y", 0) == 0);
+      /* U+00D7 MULTIPLICATION SIGN */
+      ASSERT (fnmatch ("x[[:alnum:]]y", "x\303\227y", 0) == FNM_NOMATCH);
+      /* U+00D7 MULTIPLICATION SIGN */
+      ASSERT (fnmatch ("x[[:alpha:]]y", "x\303\227y", 0) == FNM_NOMATCH);
+      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
+      ASSERT (fnmatch ("x[[:blank:]]y", "x\305\201y", 0) == FNM_NOMATCH);
+      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
+      ASSERT (fnmatch ("x[[:cntrl:]]y", "x\305\201y", 0) == FNM_NOMATCH);
+      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
+      ASSERT (fnmatch ("x[[:digit:]]y", "x\305\201y", 0) == FNM_NOMATCH);
+      /* U+2002 EN SPACE */
+      ASSERT (fnmatch ("x[[:graph:]]y", "x\342\200\202y", 0) == FNM_NOMATCH);
+      /* U+00B2 SUPERSCRIPT TWO */
+      ASSERT (fnmatch ("x[[:lower:]]y", "x\302\262y", 0) == FNM_NOMATCH);
+      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
+      ASSERT (fnmatch ("x[[:punct:]]y", "x\305\201y", 0) == FNM_NOMATCH);
+      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
+      ASSERT (fnmatch ("x[[:space:]]y", "x\305\201y", 0) == FNM_NOMATCH);
+      /* U+00B2 SUPERSCRIPT TWO */
+      ASSERT (fnmatch ("x[[:upper:]]y", "x\302\262y", 0) == FNM_NOMATCH);
+      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
+      ASSERT (fnmatch ("x[[:xdigit:]]y", "x\305\201y", 0) == FNM_NOMATCH);
+
+      #if GNULIB_FNMATCH_GNU && defined FNM_CASEFOLD
+      /* "özgür" */
+      {
+        /* Some platforms, e.g. MSVC 14, lack the upper/lower mappings for
+           these wide characters in the *.65001 locales.  */
+        mbstate_t state;
+        wchar_t wc;
+        memset (&state, 0, sizeof (mbstate_t));
+        if (mbrtowc (&wc, "\303\274", 2, &state) == 2
+            && towupper (wc) != wc)
+          {
+            ASSERT (fnmatch ("\303\266zg\303\274r", "\303\226ZG\303\234R", FNM_CASEFOLD) == 0);
+            ASSERT (fnmatch ("\303\226ZG\303\234R", "\303\266zg\303\274r", FNM_CASEFOLD) == 0);
+            ASSERT (fnmatch ("\303\266Zg\303\234r", "\303\226zG\303\274R", FNM_CASEFOLD) == 0);
+            ASSERT (fnmatch ("\303\226zG\303\274R", "\303\266Zg\303\234r", FNM_CASEFOLD) == 0);
+          }
+      }
+      #endif
+
+      return 0;
+
     case 932:
       /* Locale encoding is CP932, similar to Shift_JIS.  */
 
@@ -288,88 +370,6 @@ test_one_locale (const char *name, int codepage)
 
       return 0;
 
-    case 65001:
-      /* Locale encoding is CP65001 = UTF-8.  */
-      if (strcmp (locale_charset (), "UTF-8") != 0)
-        return 77;
-
-      ASSERT (fnmatch ("x?y", "x\303\274y", 0) == 0); /* "xüy" */
-      ASSERT (fnmatch ("x?y", "x\303\237y", 0) == 0); /* "xßy" */
-      ASSERT (fnmatch ("x?y", "x\360\237\230\213y", 0) == 0); /* "x😋y" */
-      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
-      ASSERT (fnmatch ("x[[:alnum:]]y", "x\305\201y", 0) == 0);
-      /* U+10330 GOTHIC LETTER AHSA */
-      ASSERT (fnmatch ("x[[:alnum:]]y", "x\360\220\214\260y", 0) == 0);
-      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
-      ASSERT (fnmatch ("x[[:alpha:]]y", "x\305\201y", 0) == 0);
-      /* U+10330 GOTHIC LETTER AHSA */
-      ASSERT (fnmatch ("x[[:alpha:]]y", "x\360\220\214\260y", 0) == 0);
-      /* U+00B8 CEDILLA */
-      ASSERT (fnmatch ("x[[:graph:]]y", "x\302\270y", 0) == 0);
-      /* U+20000 <CJK Ideograph> */
-      ASSERT (fnmatch ("x[[:graph:]]y", "x\360\240\200\200y", 0) == 0);
-      /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */
-      ASSERT (fnmatch ("x[[:lower:]]y", "x\303\277y", 0) == 0);
-      /* U+10441 DESERET SMALL LETTER EF */
-      ASSERT (fnmatch ("x[[:lower:]]y", "x\360\220\221\201y", 0) == 0);
-      /* U+00B8 CEDILLA */
-      ASSERT (fnmatch ("x[[:print:]]y", "x\302\270y", 0) == 0);
-      /* U+20000 <CJK Ideograph> */
-      ASSERT (fnmatch ("x[[:print:]]y", "x\360\240\200\200y", 0) == 0);
-      /* U+00BF INVERTED QUESTION MARK */
-      ASSERT (fnmatch ("x[[:punct:]]y", "x\302\277y", 0) == 0);
-      /* U+1D100 MUSICAL SYMBOL SINGLE BARLINE */
-      ASSERT (fnmatch ("x[[:punct:]]y", "x\360\235\204\200y", 0) == 0);
-      /* U+3000 IDEOGRAPHIC SPACE */
-      ASSERT (fnmatch ("x[[:space:]]y", "x\343\200\200y", 0) == 0);
-      /* U+0429 CYRILLIC CAPITAL LETTER SHCHA */
-      ASSERT (fnmatch ("x[[:upper:]]y", "x\320\251y", 0) == 0);
-      /* U+10419 DESERET CAPITAL LETTER EF */
-      ASSERT (fnmatch ("x[[:upper:]]y", "x\360\220\220\231y", 0) == 0);
-      /* U+00D7 MULTIPLICATION SIGN */
-      ASSERT (fnmatch ("x[[:alnum:]]y", "x\303\227y", 0) == FNM_NOMATCH);
-      /* U+00D7 MULTIPLICATION SIGN */
-      ASSERT (fnmatch ("x[[:alpha:]]y", "x\303\227y", 0) == FNM_NOMATCH);
-      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
-      ASSERT (fnmatch ("x[[:blank:]]y", "x\305\201y", 0) == FNM_NOMATCH);
-      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
-      ASSERT (fnmatch ("x[[:cntrl:]]y", "x\305\201y", 0) == FNM_NOMATCH);
-      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
-      ASSERT (fnmatch ("x[[:digit:]]y", "x\305\201y", 0) == FNM_NOMATCH);
-      /* U+2002 EN SPACE */
-      ASSERT (fnmatch ("x[[:graph:]]y", "x\342\200\202y", 0) == FNM_NOMATCH);
-      /* U+00B2 SUPERSCRIPT TWO */
-      ASSERT (fnmatch ("x[[:lower:]]y", "x\302\262y", 0) == FNM_NOMATCH);
-      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
-      ASSERT (fnmatch ("x[[:punct:]]y", "x\305\201y", 0) == FNM_NOMATCH);
-      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
-      ASSERT (fnmatch ("x[[:space:]]y", "x\305\201y", 0) == FNM_NOMATCH);
-      /* U+00B2 SUPERSCRIPT TWO */
-      ASSERT (fnmatch ("x[[:upper:]]y", "x\302\262y", 0) == FNM_NOMATCH);
-      /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */
-      ASSERT (fnmatch ("x[[:xdigit:]]y", "x\305\201y", 0) == FNM_NOMATCH);
-
-      #if GNULIB_FNMATCH_GNU && defined FNM_CASEFOLD
-      /* "özgür" */
-      {
-        /* Some platforms, e.g. MSVC 14, lack the upper/lower mappings for
-           these wide characters in the *.65001 locales.  */
-        mbstate_t state;
-        wchar_t wc;
-        memset (&state, 0, sizeof (mbstate_t));
-        if (mbrtowc (&wc, "\303\274", 2, &state) == 2
-            && towupper (wc) != wc)
-          {
-            ASSERT (fnmatch ("\303\266zg\303\274r", "\303\226ZG\303\234R", FNM_CASEFOLD) == 0);
-            ASSERT (fnmatch ("\303\226ZG\303\234R", "\303\266zg\303\274r", FNM_CASEFOLD) == 0);
-            ASSERT (fnmatch ("\303\266Zg\303\234r", "\303\226zG\303\274R", FNM_CASEFOLD) == 0);
-            ASSERT (fnmatch ("\303\226zG\303\274R", "\303\266Zg\303\234r", FNM_CASEFOLD) == 0);
-          }
-      }
-      #endif
-
-      return 0;
-
     default:
       return 1;
     }