+2023-10-11 Bruno Haible <bruno@clisp.org>
+
+ unictype/category-and-not: Add more tests.
+ Suggested by Arindam Sharma <arindam.sharma@imperial.ac.uk>.
+ * tests/unictype/test-categ_and_not.c (main): Add two more test cases.
+ * modules/unictype/category-and-not-tests (Depends-on): Add
+ unictype/category-Cc.
+
2023-10-09 Bruno Haible <bruno@clisp.org>
tests: Refactor functions for signalling NaNs.
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;
}