From 00893e79fc62966067af1a106567db96bd170338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 3 Mar 2024 19:11:32 +0100 Subject: New upstream version 1.2 --- tests/unictype/test-categ_and_not.c | 41 ++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'tests/unictype/test-categ_and_not.c') 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; } -- cgit v1.2.3