mirror of
https://https.git.savannah.gnu.org/git/gnulib.git
synced 2026-09-01 02:34:55 +00:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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@' \
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Test a CP1252 locale.
|
||||
${CHECKER} ./test-fnmatch-w32${EXEEXT} French_France 1252
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Test a GB18030 locale.
|
||||
${CHECKER} ./test-fnmatch-w32${EXEEXT} Chinese_China 54936
|
||||
+82
-82
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user