summaryrefslogtreecommitdiff
path: root/tests/test-wctype-h.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-wctype-h.c')
-rw-r--r--tests/test-wctype-h.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/tests/test-wctype-h.c b/tests/test-wctype-h.c
index 08da56b5..016fd8fc 100644
--- a/tests/test-wctype-h.c
+++ b/tests/test-wctype-h.c
@@ -1,5 +1,5 @@
/* Test of <wctype.h> substitute.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,8 +20,6 @@
#include <wctype.h>
-#include "macros.h"
-
/* Check that the type wint_t is defined. */
wint_t a = 'x';
/* Check that WEOF is defined. */
@@ -33,6 +31,8 @@ wctype_t p;
/* Check that the type wctrans_t is defined. */
wctrans_t q;
+#include "macros.h"
+
int
main (void)
{
@@ -62,6 +62,43 @@ main (void)
ASSERT (!iswupper (e));
ASSERT (!iswxdigit (e));
+ /* Sanity check for the iswprint function. */
+ ASSERT (iswprint (L' '));
+ ASSERT (!iswprint (L'\t'));
+ ASSERT (!iswprint (L'\n'));
+
+ /* Sanity check for the iswpunct function.
+ These characters are usually expected to be punctuation or symbol
+ characters. */
+ ASSERT (iswpunct (L'!'));
+ ASSERT (iswpunct (L'"'));
+ ASSERT (iswpunct (L'#'));
+ ASSERT (iswpunct (L'%'));
+ ASSERT (iswpunct (L'&'));
+ ASSERT (iswpunct (L'\''));
+ ASSERT (iswpunct (L'('));
+ ASSERT (iswpunct (L')'));
+ ASSERT (iswpunct (L'*'));
+ ASSERT (iswpunct (L','));
+ ASSERT (iswpunct (L'-'));
+ ASSERT (iswpunct (L'.'));
+ ASSERT (iswpunct (L'/'));
+ ASSERT (iswpunct (L':'));
+ ASSERT (iswpunct (L';'));
+ ASSERT (iswpunct (L'?'));
+ ASSERT (iswpunct (L'@'));
+ ASSERT (iswpunct (L'['));
+ ASSERT (iswpunct (L'\\'));
+ ASSERT (iswpunct (L']'));
+ ASSERT (iswpunct (L'_'));
+ ASSERT (iswpunct (L'{'));
+ ASSERT (iswpunct (L'}'));
+ ASSERT (!iswpunct (L'5'));
+ ASSERT (!iswpunct (L'F'));
+ ASSERT (!iswpunct (L' '));
+ ASSERT (!iswpunct (L'\t'));
+ ASSERT (!iswpunct (L'\n'));
+
/* Check that the tow* functions exist as functions or as macros. */
(void) towlower (0);
(void) towupper (0);