summaryrefslogtreecommitdiff
path: root/tests/unictype/test-categ_and_not.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:45 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:45 +0100
commit7cf710f6587e71a193a55d84dd6d8ae1a8a69ce0 (patch)
treedb628840acea83dbccaf5676b89579a80e02ef51 /tests/unictype/test-categ_and_not.c
parentd83e85a2e6064c36f6ad3c848e39d8b8c101c4f7 (diff)
parent00893e79fc62966067af1a106567db96bd170338 (diff)
Update upstream source from tag 'upstream/1.2'
Update to upstream version '1.2' with Debian dir 16dafe941db3036235f48227f29c6a73587c376d
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;
}