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/unigbrk/test-uc-is-grapheme-break.c | 33 ++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'tests/unigbrk/test-uc-is-grapheme-break.c') diff --git a/tests/unigbrk/test-uc-is-grapheme-break.c b/tests/unigbrk/test-uc-is-grapheme-break.c index 433ba686..92674a07 100644 --- a/tests/unigbrk/test-uc-is-grapheme-break.c +++ b/tests/unigbrk/test-uc-is-grapheme-break.c @@ -1,5 +1,5 @@ /* Grapheme cluster break function test. - Copyright (C) 2010-2022 Free Software Foundation, Inc. + Copyright (C) 2010-2024 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -30,7 +30,6 @@ const char * graphemebreakproperty_to_string (int gbp) { - printf ("%d\n", gbp); switch (gbp) { #define CASE(VALUE) case GBP_##VALUE: return #VALUE; @@ -89,6 +88,9 @@ main (int argc, char *argv[]) const char *p; ucs4_t prev; int last_char_prop; + bool incb_consonant_extended; + bool incb_consonant_extended_linker; + bool incb_consonant_extended_linker_extended; bool emoji_modifier_sequence; bool emoji_modifier_sequence_before_last_char; size_t ri_count; @@ -102,6 +104,9 @@ main (int argc, char *argv[]) continue; last_char_prop = -1; + incb_consonant_extended = false; + incb_consonant_extended_linker = false; + incb_consonant_extended_linker_extended = false; emoji_modifier_sequence = false; emoji_modifier_sequence_before_last_char = false; ri_count = 0; @@ -150,10 +155,17 @@ main (int argc, char *argv[]) next = next_int; } + int incb = uc_indic_conjunct_break (next); + /* Skip unsupported rules involving 3 or more characters. */ - if (last_char_prop == GBP_ZWJ - && emoji_modifier_sequence_before_last_char - && uc_is_property_extended_pictographic (next)) + if (incb_consonant_extended_linker_extended + && incb == UC_INDIC_CONJUNCT_BREAK_CONSONANT) + fprintf (stderr, "%s:%d: skipping GB9c: should join U+%04X " + "and U+%04X\n", + filename, lineno, prev, next); + else if (last_char_prop == GBP_ZWJ + && emoji_modifier_sequence_before_last_char + && uc_is_property_extended_pictographic (next)) { int prev_gbp = uc_graphemeclusterbreak_property (prev); int next_gbp = uc_graphemeclusterbreak_property (next); @@ -190,6 +202,17 @@ main (int argc, char *argv[]) p += strspn (p, " \t\r\n"); prev = next; + incb_consonant_extended_linker = + incb_consonant_extended && incb == UC_INDIC_CONJUNCT_BREAK_LINKER; + incb_consonant_extended_linker_extended = + (incb_consonant_extended_linker + || (incb_consonant_extended_linker_extended + && incb >= UC_INDIC_CONJUNCT_BREAK_LINKER)); + incb_consonant_extended = + (incb == UC_INDIC_CONJUNCT_BREAK_CONSONANT + || (incb_consonant_extended + && incb >= UC_INDIC_CONJUNCT_BREAK_LINKER)); + emoji_modifier_sequence_before_last_char = emoji_modifier_sequence; emoji_modifier_sequence = (emoji_modifier_sequence -- cgit v1.2.3