From 01b1c5938372e72d7d0af2b123b37d9add3d235c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 30 Aug 2023 02:18:40 +0200 Subject: [PATCH] c32ispunct: Rely on module iswpunct. * modules/c32ispunct (Depends-on): Add iswpunct. * tests/test-c32ispunct.c (main): Add a few more tests in the "C" locale. --- ChangeLog | 5 +++++ modules/c32ispunct | 1 + tests/test-c32ispunct.c | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index a21cdf3ccf..ae888b304a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2023-08-29 Bruno Haible + c32ispunct: Rely on module iswpunct. + * modules/c32ispunct (Depends-on): Add iswpunct. + * tests/test-c32ispunct.c (main): Add a few more tests in the "C" + locale. + iswpunct: Add tests. * tests/test-iswpunct.c: New file, based on tests/test-iswdigit.c and tests/test-c32ispunct.c. diff --git a/modules/c32ispunct b/modules/c32ispunct index bb78c9ea6a..ff9ee40825 100644 --- a/modules/c32ispunct +++ b/modules/c32ispunct @@ -16,6 +16,7 @@ Depends-on: uchar wchar wctype-h +iswpunct localcharset [test $REPLACE_MBSTATE_T = 1] streq [test $REPLACE_MBSTATE_T = 1] unictype/ctype-punct diff --git a/tests/test-c32ispunct.c b/tests/test-c32ispunct.c index 5167e89cf9..f0df92b9f1 100644 --- a/tests/test-c32ispunct.c +++ b/tests/test-c32ispunct.c @@ -136,6 +136,15 @@ main (int argc, char *argv[]) { case '0': /* C locale; tested above. */ + /* These characters are not in the ISO C "basic character set", but + are nevertheless usually expected to be punctuation or symbol + characters. */ + is = for_character ("$", 1); + ASSERT (is != 0); + is = for_character ("@", 1); + ASSERT (is != 0); + is = for_character ("`", 1); + ASSERT (is != 0); return 0; case '1': -- 2.39.5