summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Paul Eggert2022-01-011353-1353/+1353
|
* Update to Unicode 14.0.0.Bruno Haible2021-12-3197-1101/+3077
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (UC_JOINING_GROUP_THIN_YEH, UC_JOINING_GROUP_VERTICAL_TAIL): New enum values. (fill_arabicshaping, joining_group_as_c_identifier): Recognize these joining groups. * lib/unictype.in.h (UC_JOINING_GROUP_THIN_YEH, UC_JOINING_GROUP_VERTICAL_TAIL): New enum values. * lib/unictype/joininggroup_name.h: Add the THIN_YEH, VERTICAL_TAIL joining groups. * lib/unictype/joininggroup_byname.gperf: Likewise. * lib/gen-uni-tables.c (LBP_ID1, LBP_ID2): New enum values. (LBP_ID): Assign artificial value. (get_lbp): Use the extended_pictographic property to assign LBP_ID1, LBP_ID2 instead of LBP_ID. Update such that unilbrk/lbrkprop.txt comes out as expected. (debug_output_lbp): Print either LBP_ID1 or LBP_ID2 as LBP_ID. (lbp_value_to_string): Handle LBP_ID1, LBP_ID2 instead of LBP_ID. (output_lbrk_rules_as_tables): Treat LBP_ID as macro that maps to two table rows/columns. In rule LB30b, use LBP_ID2 in addition to LBP_EB. Remove redundant part of rule LB27. * lib/unilbrk/lbrktables.h (LBP_ID1, LBP_ID2): New enum values. (LBP_ID): Remove enum value. (unilbrk_table): Update declaration. * lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop): Use LBP_ID1 instead of LBP_ID. * lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop): Likewise. * lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop): Likewise. * tests/unilbrk/test-u8-possible-linebreaks.c (test_function): Add a test of potential future emoji. * tests/unilbrk/test-u16-possible-linebreaks.c (test_function): Likewise. * tests/unilbrk/test-u32-possible-linebreaks.c (test_function): Likewise. * lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind): Update. (uc_width): Assign width 2 to the characters 0x1AFF0..0x1AFF3, 0x1AFF5..0x1AFFB, 0x1AFFD..0x1AFFE, 0x1B120..0x1B122, 0x1F6DD..0x1F6DF, 0x1F7F0, 0x1FA7B..0x1FA7C, 0x1FAA9..0x1FAAC, 0x1FAB7..0x1FABA, 0x1FAC3..0x1FAC5, 0x1FAD7..0x1FAD9, 0x1FAE0..0x1FAE7, 0x1FAF0..0x1FAF6. * tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters 0x0890..0x0891, 0x0898..0x089F, 0x08CA..0x0902, 0x0C3C, 0x180F, 0x1AC1..0x1ACE, 0x1DFA, 0x10F82..0x10F85, 0x11070, 0x11073..0x11074, 0x110C2, 0x1CF00..0x1CF2D, 0x1CF30..0x1CF46, 0x1E2AE. Expect ambiguous width for the character 0x1734. Expect width 2 for the characters 0x1AFF0..0x1AFF3, 0x1AFF5..0x1AFFB, 0x1AFFD..0x1AFFE, 0x1B120..0x1B122, 0x1F6DD..0x1F6DF, 0x1F7F0, 0x1FA7B..0x1FA7C, 0x1FAA9..0x1FAAC, 0x1FAB7..0x1FABA, 0x1FAC3..0x1FAC5, 0x1FAD7..0x1FAD9, 0x1FAE0..0x1FAE7, 0x1FAF0..0x1FAF6. * All generated files under lib/uni* and tests/uni*: Regenerate. * tests/uniname/NameAliases.txt: Update. * tests/uniname/UnicodeData.txt: Update. * tests/uninorm/NormalizationTest.txt: Update. * tests/unigbrk/GraphemeBreakTest.txt: Update. * tests/uniwbrk/WordBreakTest.txt: Update. * All the affected modules: Bump required libunistring version.
* Update to Unicode 13.0.0.Bruno Haible2021-12-3189-702/+2324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (is_WBP_MIDLETTER): Add character 0x055F. (get_wbp): Assign value WBP_ALETTER to the characters 0x02E5..0x02EB, 0x055A, 0x058A, 0xA708..0xA716. * lib/gen-uni-tables.c (LBP_CP1, LBP_CP2, LBP_OP1, LBP_OP2): New enum values. (LBP_OP, LBP_CP): Assign artificial values. (get_lbp): Use the unicode_width[] table to assign LBP_CP1, LBP_CP2 instead of LBP_CP, and LBP_OP1, LBP_OP2 instead of LBP_OP. Update such that unilbrk/lbrkprop.txt comes out as expected. (debug_output_lbp): Print either LBP_CP1 or LBP_CP2 as LBP_CP. Print either LBP_OP1 or LBP_OP2 as LBP_OP. (lbp_value_to_string): Handle LBP_CP1, LBP_CP2, LBP_OP1, LBP_OP2 instead of LBP_CP, LBP_OP. (output_lbrk_rules_as_tables): Treat LBP_CP and LBP_OP as macros that map to two table rows/columns. In rule LB30, use only LBP_OP1 instead of LBP_OP, and only LBP_CP1 instead of LBP_CP. Simplify rule LB22. * lib/unilbrk/lbrktables.h (LBP_CP1, LBP_CP2, LBP_OP1, LBP_OP2): New enum values. (LBP_OP, LBP_CP): Remove enum values. (unilbrk_table): Update declaration. * lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop): Add a test for East Asian opening parenthesis. * lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop): Likewise. * lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop): Likewise. * lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind): Update. (uc_width): Assign width 2 to the characters 0x16FF0..0x16FF1, 0x18AF3..0x18CD5, 0x18D00..0x18D08, 0x1F6D6..0x1F6D7, 0x1F6FB..0x1F6FC, 0x1F90C, 0x1FA74, 0x1FA83..0x1FA86, 0x1FA96..0x1FAA8, 0x1FAB0..0x1FAB6, 0x1FAC0..0x1FAC2, 0x1FAD0..0x1FAD6. Assign width 1 to the characters 0x1F93B, 0x1F946. * tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters 0x0B55, 0x0D81, 0x1ABF..0x1AC0, 0xA82C, 0x10EAB..0x10EAC, 0x111CF, 0x1193B..0x1193C, 0x1193E, 0x11943, 0x16FE4. Expect width 2 for the characters 0x16FF0..0x16FF1, 0x18AF3..0x18CD5, 0x18D00..0x18D08, 0x1F6D6..0x1F6D7, 0x1F6FB..0x1F6FC, 0x1F90C, 0x1FA74, 0x1FA83..0x1FA86, 0x1FA96..0x1FAA8, 0x1FAB0..0x1FAB6, 0x1FAC0..0x1FAC2, 0x1FAD0..0x1FAD6. Expect width 1 for the characters 0x1F93B, 0x1F946. * All generated files under lib/uni* and tests/uni*: Regenerate. * tests/uniname/NameAliases.txt: Update. * tests/uniname/UnicodeData.txt: Update. * tests/uninorm/NormalizationTest.txt: Update. * tests/unigbrk/GraphemeBreakTest.txt: Update. * tests/uniwbrk/WordBreakTest.txt: Update. * All the affected modules: Bump required libunistring version.
* Update to Unicode 12.1.0.Bruno Haible2021-12-3023-33/+26
| | | | | | | | | | | | | * lib/gen-uni-tables.c: Update comments. * All generated files under lib/uni* and tests/uni*: Regenerate. * tests/uniname/NameAliases.txt: Update. * tests/uniname/UnicodeData.txt: Update. * tests/uninorm/NormalizationTest.txt: Update. * tests/unigbrk/GraphemeBreakTest.txt: Update. * tests/uniwbrk/WordBreakTest.txt: Update. * All the affected modules: Bump required libunistring version.
* Update to Unicode 12.0.0.Bruno Haible2021-12-3085-720/+1771
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (is_property_default_ignorable_code_point): Exclude 0x13430..0x13438. (get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected. (get_wbp): Map 0xFF10..0xFF19 to WBP_NUMERIC. * lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind): Update. (uc_width): Assign width 2 to the characters 0x16FE2..0x16FE3, 0x187F2..0x187F7, 0x1B150..0x1B152, 0x1B164..0x1B167, 0x1F6D5, 0x1F6FA, 0x1F7E0..0x1F7EB, 0x1F90D..0x1F90F, 0x1FA70..0x1FA73, 0x1FA78..0x1FA7A, 0x1FA80..0x1FA82, 0x1FA90..0x1FA95. * tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters 0x0EBA, 0xA9BD, 0x119D4..0x119D7, 0x119DA..0x119DB, 0x119E0, 0x13430..0x13438, 0x16F4F, 0x1E130..0x1E136, 0x1E2EC..0x1E2EF. Expect width 2 for the characters 0x16FE2..0x16FE3, 0x187F2..0x187F7, 0x1B150..0x1B152, 0x1B164..0x1B167, 0x1F6D5, 0x1F6FA, 0x1F7E0..0x1F7EB, 0x1F90D..0x1F90F, 0x1FA70..0x1FA73, 0x1FA78..0x1FA7A, 0x1FA80..0x1FA82, 0x1FA90..0x1FA95. * All generated files under lib/uni* and tests/uni*: Regenerate. * tests/uniname/NameAliases.txt: Update. * tests/uniname/UnicodeData.txt: Update. * tests/uninorm/NormalizationTest.txt: Update. * tests/unigbrk/GraphemeBreakTest.txt: Update. * tests/uniwbrk/WordBreakTest.txt: Update. * All the affected modules: Bump required libunistring version.
* Update to Unicode 11.0.0.Bruno Haible2021-12-3088-1861/+3112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (is_property_default_ignorable_code_point): Simplify by use of PROP_PREPENDED_CONCATENATION_MARK. (UC_JOINING_GROUP_HANIFI_ROHINGYA_PA, UC_JOINING_GROUP_HANIFI_ROHINGYA_KINNA_YA): New enum values. (fill_arabicshaping, joining_group_as_c_identifier): Recognize these joining groups. (get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected. (WBP_EB, WBP_EM, WBP_GAZ, WBP_EBG): Remove enum values. (WBP_WSS): New enum value. (get_wbp): Update such that uniwbrk/wbrkprop.txt comes out as expected. (debug_output_wbp, fill_org_wbp, debug_output_org_wbp, output_wbp): Update for changed enum values. * lib/unictype.in.h (UC_JOINING_GROUP_HANIFI_ROHINGYA_*): New enum values. * lib/unictype/joininggroup_name.h: Add the HANIFI_ROHINGYA_* joining groups. * lib/unictype/joininggroup_byname.gperf: Likewise. * lib/unigbrk.in.h: Mark 4 enum values as obsolete. * lib/unigbrk/u-grapheme-breaks.h (FUNC): Handle emoji modifier sequence according to Unicode 11.0.0. * lib/unigbrk/u8-grapheme-breaks.c: Include <stdbool.h>, unictype.h. * lib/unigbrk/u16-grapheme-breaks.c: Likewise. * lib/unigbrk/u32-grapheme-breaks.c: Likewise. * lib/unigbrk/uc-grapheme-breaks.c: Likewise. * modules/unigbrk/u8-grapheme-breaks (Depends-on): Add unictype/property-extended-pictographic, stdbool. * modules/unigbrk/u16-grapheme-breaks (Depends-on): Likewise. * modules/unigbrk/u32-grapheme-breaks (Depends-on): Likewise. * modules/unigbrk/uc-grapheme-breaks (Depends-on): Likewise. * tests/unigbrk/test-u8-grapheme-breaks.c (main): Add test for emoji modifier / ZWJ sequence. * tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise. * tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise. * tests/unigbrk/test-uc-is-grapheme-break.c: Include <stdbool.h>, unictype.h. (main): Update workaround logic to match the one in lib/unigbrk/u-grapheme-breaks.h. * modules/unigbrk/uc-is-grapheme-break-tests (Depends-on): Add unictype/property-extended-pictographic, stdbool. * lib/uniwbrk.in.h: Mark 4 enum values as obsolete. (WBP_WSS): New enum value. * lib/uniwbrk/u-wordbreaks.h (FUNC): Handle emoji ZWJ sequences and horizontal whitespace according to Unicode 11.0.0. * lib/uniwbrk/u8-wordbreaks.c: Include unictype.h. * lib/uniwbrk/u16-wordbreaks.c: Likewise. * lib/uniwbrk/u32-wordbreaks.c: Likewise. * lib/uniwbrk/wbrktable.c (uniwbrk_prop_index, uniwbrk_table): Add a row and column for WBP_WSS. * lib/uniwbrk/wbrktable.h (uniwbrk_prop_index, uniwbrk_table): Update declarations. * modules/uniwbrk/u8-wordbreaks (Depends-on): Add unictype/property-extended-pictographic. * modules/uniwbrk/u16-wordbreaks (Depends-on): Likewise. * modules/uniwbrk/u32-wordbreaks (Depends-on): Likewise. * tests/uniwbrk/test-u8-wordbreaks.c (main): Update expected results. * tests/uniwbrk/test-u16-wordbreaks.c (main): Likewise. * tests/uniwbrk/test-u32-wordbreaks.c (main): Likewise. * tests/uniwbrk/test-uc-wordbreaks.c (wordbreakproperty_to_string): Update. * lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop): Handle ZWJ according to Unicode 11.0.0. * lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop): Likewise. * lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop): Likewise. * lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind): Update. (uc_width): Assign width 2 to the characters 0x187ED..0x187F1, 0x1F6F9, 0x1F9E7..0x1F9FF. * tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters 0x07FD, 0x08D3, 0x09FE, 0x0C04, 0xA8FF, 0x10D24..0x10D27, 0x10F46..0x10F50, 0x110CD, 0x111C9, 0x1133B, 0x1145E, 0x1182F..0x11837, 0x11839..0x1183A, 0x11D90..0x11D91, 0x11D95, 0x11D97, 0x11EF3..0x11EF4. Expect width 2 for the characters 0x187ED..0x187F1, 0x1F6F9, 0x1F9E7..0x1F9FF. * All generated files under lib/uni* and tests/uni*: Regenerate. * tests/uniname/NameAliases.txt: Update. * tests/uniname/UnicodeData.txt: Update. * tests/uninorm/NormalizationTest.txt: Update. * tests/unigbrk/GraphemeBreakTest.txt: Update. * tests/uniwbrk/WordBreakTest.txt: Update. * All the affected modules: Bump required libunistring version.
* unictype: Add Emoji properties from Unicode 11.0.0.Bruno Haible2021-12-306-0/+478
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (PROP_EMOJI*, PROP_EXTENDED_PICTOGRAPHIC): New enum values. (fill_properties): Don't require a space between the property name and the comment. Handle the property names from emoji-data.txt. (is_property_emoji, is_property_emoji_presentation, is_property_emoji_modifier, is_property_emoji_modifier_base, is_property_emoji_component, is_property_extended_pictographic): New declarations. (output_properties): Emit the properties emoji, emoji_presentation, emoji_modifier, emoji_modifier_base, emoji_component, extended_pictographic. (get_lbp): Use the emoji_modifier property. (main): Expect one more argument, for the emoji-data.txt file. * lib/unictype.in.h (UC_PROPERTY_EMOJI, UC_PROPERTY_EMOJI_PRESENTATION, UC_PROPERTY_EMOJI_MODIFIER, UC_PROPERTY_EMOJI_MODIFIER_BASE, UC_PROPERTY_EMOJI_COMPONENT, UC_PROPERTY_EXTENDED_PICTOGRAPHIC, uc_is_property_emoji, uc_is_property_emoji_presentation, uc_is_property_emoji_modifier, uc_is_property_emoji_modifier_base, uc_is_property_emoji_component, uc_is_property_extended_pictographic): New declarations. * lib/unictype/pr_emoji.c: New file. * lib/unictype/pr_emoji_presentation.c: New file. * lib/unictype/pr_emoji_modifier.c: New file. * lib/unictype/pr_emoji_modifier_base.c: New file. * lib/unictype/pr_emoji_component.c: New file. * lib/unictype/pr_extended_pictographic.c: New file. * modules/unictype/property-emoji: New file. * modules/unictype/property-emoji-tests: New file. * modules/unictype/property-emoji-presentation: New file. * modules/unictype/property-emoji-presentation-tests: New file. * modules/unictype/property-emoji-modifier: New file. * modules/unictype/property-emoji-modifier-tests: New file. * modules/unictype/property-emoji-modifier-base: New file. * modules/unictype/property-emoji-modifier-base-tests: New file. * modules/unictype/property-emoji-component: New file. * modules/unictype/property-emoji-component-tests: New file. * modules/unictype/property-extended-pictographic: New file. * modules/unictype/property-extended-pictographic-tests: New file. * modules/unictype/property-all (Depends-on): Depend on the new modules.
* uniwidth: Give width 0 to conjoining Hangul Jamo jungseong, jongseong.Bruno Haible2021-12-301-2/+7
| | | | | | | | | | | | Reported by Luis Javier Merino <ninjalj@gmail.com> in <https://lists.gnu.org/archive/html/bug-libunistring/2021-12/msg00006.html>. * lib/gen-uni-tables.c (is_nonspacing): Return true for the conjoining Hangul Jamo jungseong and jongseong characters. * lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind): Regenerated. * tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters 0x1160..0x11FF, 0xD7B0..0xD7C6, 0xD7CB..0xD7FB.
* uniwidth: Update to Unicode 10.0.0.Bruno Haible2021-12-291-6/+142
| | | | | | | | | | | | | | | | | | | * lib/uniwidth/width.c (uc_width): Assign width 2 to the characters 0x231A..0x231B, 0x23E9..0x23EC, 0x23F0, 0x23F3, 0x25FD..0x25FE, 0x2614..0x2615, 0x2648..0x2653, 0x267F, 0x2693, 0x26A1, 0x26AA..0x26AB, 0x26BD..0x26BE, 0x26C4..0x26C5, 0x26CE, 0x26D4, 0x26EA, 0x26F2..0x26F3, 0x26F5, 0x26FA, 0x26FD, 0x2705, 0x270A..0x270B, 0x2728, 0x274C, 0x274E, 0x2753..0x2755, 0x2757, 0x2795..0x2797, 0x27B0, 0x27BF, 0x2B1B..0x2B1C, 0x2B50, 0x2B55, 0xA960..0xA97C, 0x16FE0..0x16FE1, 0x17000..0x187EC, 0x18800..0x18AF2, 0x1B000..0x1B11F, 0x1B170..0x1B2FB, 0x1F004, 0x1F0CF, 0x1F18E, 0x1F191..0x1F19A, 0x1F200..0x1F320, 0x1F32D..0x1F335, 0x1F337..0x1F37C, 0x1F37E..0x1F393, 0x1F3A0..0x1F3CA, 0x1F3CF..0x1F3D3, 0x1F3E0..0x1F3F0, 0x1F3F4, 0x1F3F8..0x1F43E, 0x1F440, 0x1F442..0x1F4FC, 0x1F4FF..0x1F53D, 0x1F54B..0x1F54E, 0x1F550..0x1F567, 0x1F57A, 0x1F595..0x1F596, 0x1F5A4, 0x1F5FB..0x1F64F, 0x1F680..0x1F6C5, 0x1F6CC, 0x1F6D0..0x1F6D2, 0x1F6EB..0x1F6EC, 0x1F6F4..0x1F6F8, 0x1F910..0x1F9E6. Assign ambiguous width to the characters 0x3248..0x324F. * tests/uniwidth/test-uc_width2.sh: Expect these changes.
* unilbrk: Improve support for strings that contain CR-LF sequences.Bruno Haible2021-12-298-57/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (LBP_CR, LBP_LF): New enum values. (get_lbp): For '\r' and '\n', return LBP_CR and LBP_LF, respectively, instead of LBP_BK. (debug_output_lbp, fill_org_lbp, debug_output_org_lbp, lbp_value_to_string): Handle LBP_CR, LBP_LF. * lib/unilbrk/lbrkprop2.h: Regenerated. * lib/unilbrk/lbrktables.h (LBP_CR, LBP_LF): New enum values. * lib/unilbrk.in.h (UC_BREAK_CR_BEFORE_LF): New enum value. (u8_possible_linebreaks, u16_possible_linebreaks, u32_possible_linebreaks, ulc_possible_linebreaks, u8_width_linebreaks, u16_width_linebreaks, u32_width_linebreaks, ulc_width_linebreaks): Declare also a _v2 variant, and use a C macro to activate it by default. * lib/unilbrk/internal.h: New file. * lib/unilbrk/u8-possible-linebreaks.c: Include unilbrk/internal.h. (u8_possible_linebreaks_loop): Renamed from u8_possible_linebreaks. Add 'cr' parameter. (u8_possible_linebreaks, u8_possible_linebreaks_v2): New functions. (main): Update. * lib/unilbrk/u16-possible-linebreaks.c: Include unilbrk/internal.h. (u16_possible_linebreaks_loop): Renamed from u16_possible_linebreaks. Add 'cr' parameter. (u16_possible_linebreaks, u16_possible_linebreaks_v2): New functions. * lib/unilbrk/u32-possible-linebreaks.c: Include unilbrk/internal.h. (u32_possible_linebreaks_loop): Renamed from u32_possible_linebreaks. Add 'cr' parameter. (u32_possible_linebreaks, u32_possible_linebreaks_v2): New functions. * lib/unilbrk/ulc-possible-linebreaks.c: Include unilbrk/internal.h, unilbrk/lbrktables.h. (ulc_possible_linebreaks_internal): Renamed from ulc_possible_linebreaks. Add 'cr' parameter. (ulc_possible_linebreaks, ulc_possible_linebreaks_v2): New functions. (main): Update. * lib/unilbrk/u8-width-linebreaks.c: Include unilbrk/internal.h, unilbrk/lbrktables.h. (u8_width_linebreaks_internal): Renamed from u8_width_linebreaks. Add 'cr' parameter. (u8_width_linebreaks, u8_width_linebreaks_v2): New functions. (main): Update. * lib/unilbrk/u16-width-linebreaks.c: Include unilbrk/internal.h, unilbrk/lbrktables.h. (u16_width_linebreaks_internal): Renamed from u16_width_linebreaks. Add 'cr' parameter. (u16_width_linebreaks, u16_width_linebreaks_v2): New functions. * lib/unilbrk/u32-width-linebreaks.c: Include unilbrk/internal.h, unilbrk/lbrktables.h. (u32_width_linebreaks_internal): Renamed from u32_width_linebreaks. Add 'cr' parameter. (u32_width_linebreaks, u32_width_linebreaks_v2): New functions. * lib/unilbrk/ulc-width-linebreaks.c: Include unilbrk/internal.h, unilbrk/lbrktables.h. (ulc_width_linebreaks_internal): Renamed from ulc_width_linebreaks. Add 'cr' parameter. (ulc_width_linebreaks, ulc_width_linebreaks_v2): New functions. (main): Update. * modules/unilbrk/u8-possible-linebreaks (Files): Add lib/unilbrk/internal.h. * modules/unilbrk/u16-possible-linebreaks (Files): Likewise. * modules/unilbrk/u32-possible-linebreaks (Files): Likewise. * modules/unilbrk/u8-width-linebreaks (Files): Likewise. * tests/unilbrk/test-u8-possible-linebreaks.c (test_function): New function, extracted from main. Add a test of CR-LF handling. (main): Invoke it twice. * tests/unilbrk/test-u16-possible-linebreaks.c (test_function): New function, extracted from main. Add a test of CR-LF handling. (main): Invoke it twice. * tests/unilbrk/test-u32-possible-linebreaks.c (test_function): New function, extracted from main. Add a test of CR-LF handling. (main): Invoke it twice. * tests/unilbrk/test-ulc-possible-linebreaks.c (test_function): New function, extracted from main. (main): Invoke it twice. * tests/unilbrk/test-u8-width-linebreaks.c (test_function): New function, extracted from main. (main): Invoke it twice. * tests/unilbrk/test-u16-width-linebreaks.c (test_function): New function, extracted from main. (main): Invoke it twice. * tests/unilbrk/test-u32-width-linebreaks.c (test_function): New function, extracted from main. (main): Invoke it twice. * tests/unilbrk/test-ulc-width-linebreaks.c (test_function): New function, extracted from main. (main): Invoke it twice.
* uniwbrk: Add unit tests of CR-LF sequences.Bruno Haible2021-12-293-0/+50
| | | | | | | * tests/uniwbrk/test-u8-wordbreaks.c (main): Add test of a string with CR-LF. * tests/uniwbrk/test-u16-wordbreaks.c (main): Likewise. * tests/uniwbrk/test-u32-wordbreaks.c (main): Likewise.
* unigbrk: Add unit tests of CR-LF sequences.Bruno Haible2021-12-293-0/+13
| | | | | | | * tests/unigbrk/test-u8-grapheme-breaks.c (main): Add test of a string with CR-LF. * tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise. * tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise.
* unilbrk: Update handling of Hebrew letter + hyphen for Unicode 10.0.0.Bruno Haible2021-12-293-0/+51
| | | | | | | | | | | | | | * lib/unilbrk/lbrktables.h (LBP_HL_BA): New enum value. * lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Add code for handling break-after character after Hebrew letter. * lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks): Likewise. * lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks): Likewise. * tests/unilbrk/test-u8-possible-linebreaks.c (main): Add a test regarding break-after character after Hebrew letter. * tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.
* unilbrk: Update handling of regional indicators for Unicode 10.0.0.Bruno Haible2021-12-293-0/+45
| | | | | | | | | | | | | * lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Add code for handling regional indicators. * lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks): Likewise. * lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks): Likewise. * tests/unilbrk/test-u8-possible-linebreaks.c (main): Add a test regarding regional indicators. * tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.
* unilbrk: Update handling of zero-width joiner for Unicode 10.0.0.Bruno Haible2021-12-293-0/+85
| | | | | | | | | | | | | * lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Update code for zero-width joiner handling to match UAX #14 for Unicode 10.0.0. * lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks): Likewise. * lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks): Likewise. * tests/unilbrk/test-u8-possible-linebreaks.c (main): Add a test regarding zero-width joiner. * tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.
* unilbrk: Update handling of combining marks for Unicode 10.0.0.Bruno Haible2021-12-293-0/+60
| | | | | | | | | | | | | | * lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Update code for combining characters to match UAX #14 for Unicode 10.0.0. Remove legacy support for space + combining mark. * lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks): Likewise. * lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks): Likewise. * tests/unilbrk/test-u8-possible-linebreaks.c (main): Add a test regarding combining characters. * tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.
* unilbrk: Restore deviation for (IS,AL) pair.Bruno Haible2021-12-294-1/+69
| | | | | | | | | | * lib/gen-uni-tables.c (output_lbrk_rules_as_tables): Disable rule LB29. * lib/unilbrk/lbrktables.c: Regenerated. * tests/unilbrk/test-u8-possible-linebreaks.c (main): Add test case with HTML markup. * tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-ulc-possible-linebreaks.c (main): Likewise.
* unilbrk: Change algorithm to be closer to Unicode Standard Annex #14.Bruno Haible2021-12-295-8/+8
| | | | | | | | | | | | | | | * lib/gen-uni-tables.c (lbp_value_to_string): New function, extracted from output_lbp. (output_lbp): Invoke it. (output_lbrk_rules_as_tables): New function. (main): Invoke it. * lib/unilbrk/lbrktables.c: Now automatically generated. * tests/unilbrk/test-u8-possible-linebreaks.c (main): Update expected result. * tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-ulc-possible-linebreaks.c (main): Likewise. * tests/unilbrk/test-ulc-width-linebreaks.c (main): Likewise.
* uniwbrk: Add unit tests of regional indicators.Bruno Haible2021-12-293-0/+45
| | | | | | | * tests/uniwbrk/test-u8-wordbreaks.c (main): Add test of regional indicators. * tests/uniwbrk/test-u16-wordbreaks.c (main): Likewise. * tests/uniwbrk/test-u32-wordbreaks.c (main): Likewise.
* unigbrk: Simplify code for regional indicators.Bruno Haible2021-12-293-0/+14
| | | | | | | | | * lib/unigbrk/u-grapheme-breaks.h (FUNC): Make code for regional indicators more future-proof. * tests/unigbrk/test-u8-grapheme-breaks.c (main): Add test of regional indicators. * tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise. * tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise.
* timespec_getres: new modulePaul Eggert2021-12-281-0/+40
| | | | | | | | | | | * lib/time.in.h (timespec_getres): New decl. * lib/timespec_getres.c, m4/timespec_getres.m4: * modules/timespec_getres, modules/timespec_getres-tests: * tests/test-timespec_getres.c: New files. * m4/time_h.m4 (gl_TIME_H_REQUIRE_DEFAULTS, gl_TIME_H_DEFAULTS): * modules/time (time.h): Support timespec_getres.
* gen-uni-tables: Produce license notices suitable for Gnulib.Bruno Haible2021-12-28150-750/+750
| | | | | | | * lib/gen-uni-tables.c (output_library_license, output_tests_license): Produce license notices that are consistent with the gnulib/etc/license-notices/ files. * All generated files under lib/uni* and tests/uni*: Regenerate.
* Update to Unicode 10.0.0, part 3.Bruno Haible2021-12-261-255/+192
| | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected. Use is_property_regional_indicator. (get_wbp): Update such that uniwbrk/wbrkprop.txt comes out as expected. Use is_property_regional_indicator. * lib/uniname/gen-uninames.lisp (main): Ignore empty lines and comment lines in the aliases file. Needed because since 2015-06-20, we use the unmodified Unicode NameAliases.txt file. Remove reference to undefined variable. Correct indentation. * tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters 0x0AFA..0x0AFF, 0x0D00, 0x0D3B..0x0D3C, 0x1DF6..0x1DF9, 0x11A01..0x11A06, 0x11A09..0x11A0A, 0x11A33..0x11A38, 0x11A3B..0x11A3E, 0x11A47, 0x11A51..0x11A56, 0x11A59..0x11A5B, 0x11A8A..0x11A96, 0x11A98..0x11A99, 0x11D31..0x11D36, 0x11D3A, 0x11D3C..0x11D3D, 0x11D3F..0x11D45, 0x11D47.
* Update to Unicode 10.0.0.Bruno Haible2021-12-2665-759/+2450
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (PROP_REGIONAL_INDICATOR): New enum value. (fill_properties): Recognize property "Regional_Indicator". (is_property_regional_indicator): New function. (output_properties): Also output the data for regional_indicator. (UC_JOINING_GROUP_MALAYALAM_*): New enum values. (fill_arabicshaping, joining_group_as_c_identifier): Recognize these joining groups. * lib/unictype/pr_regional_indicator.c: New file. * modules/unictype/property-regional-indicator: New file. * modules/unictype/property-regional-indicator-tests: New file. * modules/unictype/property-all (Depends-on): Add unictype/property-regional-indicator. * lib/unictype.in.h (UC_JOINING_GROUP_MALAYALAM_*): New enum values. * lib/unictype/joininggroup_name.h: Add the MALAYALAM_* joining groups. * lib/unictype/joininggroup_byname.gperf: Likewise. * lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind): Update. * tests/uniwidth/test-uc_width2.sh: Update. * All generated files under lib/uni* and tests/uni*: Regenerate. * tests/uniname/NameAliases.txt: Update. * tests/uniname/UnicodeData.txt: Update. * tests/uninorm/NormalizationTest.txt: Update. * tests/unigbrk/GraphemeBreakTest.txt: Update. * tests/uniwbrk/WordBreakTest.txt: Update. * All the affected modules: Bump required libunistring version.
* hamt tests: Fix compilation error with AIX xlc.Bruno Haible2021-12-241-1/+2
| | | | * tests/test-hamt.c (test_iterator): Don't use compound initializer.
* strerrorname_np: Fix compilation error on IRIX.Bruno Haible2021-12-241-1/+1
| | | | | | * lib/strerrorname_np.c (strerrorname_np): Handle conflict between EDIRCORRUPTED and EFSCORRUPTED. * tests/test-strerrorname_np.c (main): Likewise.
* qsort_r: Fix compilation error with SunPRO C++ on Solaris 10.Bruno Haible2021-12-241-1/+1
| | | | | | * lib/stdlib.in.h (_gl_qsort_r_compar_fn): New type. (qsort_r): Use it. * tests/test-stdlib-c++.cc (qsort_r): Don't test with SunPRO C++.
* threads-h tests: Avoid clang warnings.Bruno Haible2021-12-241-0/+2
| | | | * tests/test-threads.c (main): Add 'default' to switch statements.
* test-framework-sh: remove unsafe entries from PATHBernhard Voelker2021-11-261-0/+17
| | | | | | | | | Running tests with '.' in the PATH may yield unspecified results, and is deemed unsafe per se. This includes empty entries as well which are treated like a '.' entry as per POSIX. * tests/init.sh (setup_): Add snippet to remove relative and non- accessible entries from the PATH environment variable.
* Relicense qemu.h under LGPLv2+.Bruno Haible2021-09-201-7/+7
| | | | * tests/qemu.h: Change license header.
* sm3-buffer tests: New module.Bruno Haible2021-09-191-0/+0
| | | | | | | * tests/test-sm3-buffer.c: Renamed from tests/test-sm3.c. * modules/crypto/sm3-buffer-tests: Renamed from modules/crypto/sm3-tests. Test tests/test-sm3-buffer.c instead of tests/test-sm3.c.
* sha512-buffer tests: New module.Bruno Haible2021-09-191-0/+0
| | | | | | | | | * tests/test-sha512-stream.c: Renamed from tests/test-sha512.c. * modules/crypto/sha512-buffer-tests: New file, based on modules/crypto/sha512-tests. * modules/crypto/sha512-tests: Remove tests that are now in modules/crypto/sha512-buffer-tests. Test tests/test-sha512-stream.c instead of tests/test-sha512.c.
* sha256-buffer tests: New module.Bruno Haible2021-09-191-0/+0
| | | | | | | | | * tests/test-sha256-stream.c: Renamed from tests/test-sha256.c. * modules/crypto/sha256-buffer-tests: New file, based on modules/crypto/sha256-tests. * modules/crypto/sha256-tests: Remove tests that are now in modules/crypto/sha256-buffer-tests. Test tests/test-sha256-stream.c instead of tests/test-sha256.c.
* sha1-buffer tests: New module.Bruno Haible2021-09-192-13/+42
| | | | | | | | | | | * tests/test-sha1-buffer.c: New file, based on tests/test-sha1.c. * tests/test-sha1-stream.c: Renamed from tests/test-sha1.c. (main): Remove sha1-buffer tests. * modules/crypto/sha1-buffer-tests: New file, based on modules/crypto/sha1-tests. * modules/crypto/sha1-tests: Remove tests that are now in modules/crypto/sha1-buffer-tests. Test tests/test-sha1-stream.c instead of tests/test-sha1.c.
* md5-buffer tests: New module.Bruno Haible2021-09-192-13/+44
| | | | | | | | | | | * tests/test-md5-buffer.c: New file, based on tests/test-md5.c. * tests/test-md5-stream.c: Renamed from tests/test-md5.c. (main): Remove md5-buffer tests. * modules/crypto/md5-buffer-tests: New file, based on modules/crypto/md5-tests. * modules/crypto/md5-tests: Remove tests that are now in modules/crypto/md5-buffer-tests. Test tests/test-md5-stream.c instead of tests/test-md5.c.
* md4-buffer tests: New module.Bruno Haible2021-09-191-0/+0
| | | | | | | * tests/test-md4-buffer.c: Renamed from tests/test-md4.c. * modules/crypto/md4-buffer-tests: Renamed from modules/crypto/md4-tests. Test tests/test-md4-buffer.c instead of tests/test-md4.c.
* md2-buffer tests: New module.Bruno Haible2021-09-191-0/+0
| | | | | | | * tests/test-md2-buffer.c: Renamed from tests/test-md2.c. * modules/crypto/md2-buffer-tests: Renamed from modules/crypto/md2-tests. Test tests/test-md2-buffer.c instead of tests/test-md2.c.
* stdint-tests: long long preproc on recent Sun CPaul Eggert2021-09-122-4/+5
| | | | | * tests/test-stdint.c: Test long long preprocessor constants on Oracle Developer Studio 12.6, where they should work.
* supersede: Fix test failure under QEMU user-mode for Linux/mips.Bruno Haible2021-08-302-4/+12
| | | | | | * tests/test-supersede-open.h (test_open_supersede): Copy statbuf.st_dev into a local variable of type dev_t. * tests/test-supersede-fopen.h (test_fopen_supersede): Likewise.
* spawn-pipe: Fix test failure when running under QEMU user-mode.Bruno Haible2021-08-301-6/+19
| | | | | | | | * tests/test-spawn-pipe-child.c: Include <stdbool.h>, <string.h>, qemu.h. (main): Under QEMU user-mode, allow fd 2 or fd 3 to be open. * modules/spawn-pipe-tests (Files): Add qemu.h. (Depends-on): Add stdbool.
* execute: Fix test failure when running under QEMU user-mode.Bruno Haible2021-08-301-1/+11
| | | | | | | * tests/test-execute-child.c: Include <stdbool.h>, qemu.h. (main): Under QEMU user-mode, allow fd 3 to be open. * modules/execute-tests (Files): Add qemu.h. (Depends-on): Add stdbool.
* posix_spawn_file_actions_addfchdir: Avoid test failure under QEMU.Bruno Haible2021-08-301-11/+24
| | | | | | | | | | | * tests/test-posix_spawn-fchdir.c: Include qemu.h. (is_qemu): New variable. (test): Under QEMU user-mode, don't expect that "pwd" produces the result "/". (main): Initialize is_qemu. Under QEMU user-mode, skip the relative file name test. * modules/posix_spawn_file_actions_addfchdir-tests (Files): Add qemu.h. (Depends-on): Add stdbool.
* getcwd tests: Avoid test failure when running under QEMU user-mode.Bruno Haible2021-08-301-1/+11
| | | | | | | | * modules/getcwd-tests (Files): Add qemu.h. (Depends-on): Add stdbool. * tests/test-getcwd.c: Include qemu.h. (test_long_name): Skip this test when running under QEMU user-mode. (main): Consider return code 77 from test_long_name.
* explicit_bzero test: Fix test failure due to GCC optimizations.Bruno Haible2021-08-291-4/+17
| | | | | | * tests/test-explicit_bzero.c (do_secret_stuff): Use static variable 'last_stackbuf'. (main): Use an 'if' to combine the two do_secret_stuff invocations.
* base32, base64: fix broken testsPaul Eggert2021-08-292-2/+2
| | | | | | | | | | | | Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2021-08/msg00170.html * lib/base32.c, lib/base64.c: Do not include verify.h, and omit all uses of ‘assume’. * modules/base32, modules/base64 (Depends-on): Remove verify. * tests/test-base32.c, tests/test-base64.c: Don’t pass out-of-range values to allocator, as converting them to idx_t relies on implementation-defined behavior that could trap.
* sigabbrev_np, sigdescr_np: Fix compilation error on Linux/alpha, part 2.Bruno Haible2021-08-292-2/+2
| | | | | * tests/test-sigabbrev_np.c (main): Fix syntax error. * tests/test-sigdescr_np.c (main): Likewise.
* Skip some tests when running under QEMU user-mode.Bruno Haible2021-08-299-4/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/qemu.h: New file. * tests/test-get-rusage-as.c: Include qemu.h. (main): Skip the test when running under QEMU. * tests/test-get-rusage-data.c: Include qemu.h. (main): Skip the test when running under QEMU. * tests/test-printf-posix2.c: Include qemu.h. (main): Return with code 77 when running under QEMU. * tests/test-fprintf-posix2.c: Include qemu.h. (main): Return with code 77 when running under QEMU. * tests/test-fprintf-posix3.c: Include qemu.h. (main): Return with code 79 when running under QEMU. * tests/test-fprintf-posix3.sh: Skip the test when the return code was 79. * tests/test-dprintf-posix2.c: Include qemu.h. (main): Return with code 79 when running under QEMU. Use return code 80 instead of 78. * tests/test-dprintf-posix2.sh: Skip the test when the return code was 79. Update for changed return code. * modules/get-rusage-as-tests (Files): Add qemu.h. (Depends-on): Add stdbool. * modules/get-rusage-data-tests (Files): Add qemu.h. (Depends-on): Add stdbool. * modules/fprintf-posix-tests (Files): Add qemu.h. (Depends-on): Add stdbool. * modules/dprintf-posix-tests (Files): Add qemu.h. (Depends-on): Add stdbool.
* sigabbrev_np, sigdescr_np: Fix compilation error on Linux/alpha.Bruno Haible2021-08-282-2/+2
| | | | | | | | * lib/sigabbrev_np.c (sigabbrev_np): When SIGINFO and SIGPWR have the same value, give precendence to SIGPWR. * lib/sigdescr_np.c (sigdescr_np): Likewise. * tests/test-sigabbrev_np.c (main): Likewise. * tests/test-sigdescr_np.c (main): Likewise.
* execle, execve, execvpe tests: Fix test failures under qemu user-mode.Bruno Haible2021-08-283-33/+126
| | | | | | | | * test-execle-main.c: Include <string.h>. (get_environ_assignment, create_minimal_env): New functions. (main): Call create_minimal_env. * test-execve-main.c: Likewise. * test-execvpe-main.c: Likewise.
* base32, base64: prefer signed to unsigned integersPaul Eggert2021-08-272-2/+2
| | | | | | | | | | | | | | | | | | | | * lib/base32.c, lib/base64.c: Include ialloc.h instad of stdlib.h. Include intprops.h, verify.h. * lib/base32.c (base32_encode, base32_encode_alloc, get_8, decode_8) (base32_decode_ctx, base32_decode_alloc_ctx): * lib/base32.h (struct base32_decode_context): * lib/base64.c (base64_encode_fast, base64_encode) (base64_encode_alloc, get_4, decode_4, base64_decode_ctx) (base64_decode_alloc_ctx): * lib/base64.h (struct base64_decode_context): * tests/test-base32.c (main): * tests/test-base64.c (main): Prefer signed to unsigned integers. * lib/base32.c (base32_encode_alloc): * lib/base64.c (base64_encode_alloc): Use simpler and more-direct check for overflow, removing a TODO. * lib/base32.h, lib/base64.h: Include idx.h instead of stddef.h. * modules/base32, modules/base64 (Depends-on): Add ialloc, verify.