summaryrefslogtreecommitdiff
path: root/tests/unictype/test-categ_and_not.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unictype/test-categ_and_not.c')
-rw-r--r--tests/unictype/test-categ_and_not.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/tests/unictype/test-categ_and_not.c b/tests/unictype/test-categ_and_not.c
index 74c75aee..07420d53 100644
--- a/tests/unictype/test-categ_and_not.c
+++ b/tests/unictype/test-categ_and_not.c
@@ -1,5 +1,5 @@
/* Test the Unicode character type functions.
- Copyright (C) 2007-2009 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
@@ -25,15 +25,36 @@
int
main ()
{
- uc_general_category_t ct =
- uc_general_category_and_not (
- uc_general_category_or (UC_LETTER, UC_NUMBER),
- uc_general_category_or (UC_UPPERCASE_LETTER, UC_DECIMAL_DIGIT_NUMBER));
-
- ASSERT (!uc_is_general_category ('A', ct));
- ASSERT (uc_is_general_category ('a', ct));
- ASSERT (!uc_is_general_category ('7', ct));
- ASSERT (uc_is_general_category (0x00B2, ct));
+ { /* A case where the result's bit mask is 0. */
+ uc_general_category_t ct =
+ uc_general_category_and_not (UC_UPPERCASE_LETTER, UC_LETTER);
+
+ ASSERT (!uc_is_general_category ('A', ct));
+ ASSERT (!uc_is_general_category ('a', ct));
+ }
+ { /* A case where the result's bit mask is the same as the first argument. */
+ uc_general_category_t ct =
+ uc_general_category_and_not (
+ uc_general_category_or (UC_LETTER, UC_NUMBER),
+ UC_CONTROL);
+
+ ASSERT (uc_is_general_category ('A', ct));
+ ASSERT (uc_is_general_category ('a', ct));
+ ASSERT (uc_is_general_category ('7', ct));
+ ASSERT (uc_is_general_category (0x00B2, ct));
+ }
+ { /* The general case, where the result's bit mask is neither 0 nor the first
+ argument. */
+ uc_general_category_t ct =
+ uc_general_category_and_not (
+ uc_general_category_or (UC_LETTER, UC_NUMBER),
+ uc_general_category_or (UC_UPPERCASE_LETTER, UC_DECIMAL_DIGIT_NUMBER));
+
+ ASSERT (!uc_is_general_category ('A', ct));
+ ASSERT (uc_is_general_category ('a', ct));
+ ASSERT (!uc_is_general_category ('7', ct));
+ ASSERT (uc_is_general_category (0x00B2, ct));
+ }
return 0;
}