From e6f63d744787d473083adbe9f6c0d0e91d47a121 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 3 Nov 2017 16:12:54 +0800 Subject: Add char break test cases Add char break test cases for the is_char_break variable, and fixup_broken_linebreaktest is not used any more. https://bugzilla.gnome.org/show_bug.cgi?id=789625 --- tests/CharBreakTest.txt | 11 +++++++++++ tests/EmojiBreakTest.txt | 3 +++ tests/testboundaries_ucd.c | 19 ++++++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/CharBreakTest.txt (limited to 'tests') diff --git a/tests/CharBreakTest.txt b/tests/CharBreakTest.txt new file mode 100644 index 00000000..33c9cdb0 --- /dev/null +++ b/tests/CharBreakTest.txt @@ -0,0 +1,11 @@ +# As these sequences are not specified in Unicode, +# may change the test cases if needed. + +÷ 0025 ÷ 0030 ÷ +÷ 0025 × 0308 ÷ 0030 ÷ +÷ 0024 ÷ 0030 ÷ +÷ 0024 × 0308 ÷ 0030 ÷ +÷ 0028 ÷ 0030 ÷ 002C ÷ 0031 ÷ 0029 ÷ 002B ÷ 0028 ÷ 0032 ÷ 002C ÷ 0033 ÷ 0029 ÷ 2295 ÷ 0028 ÷ 2212 ÷ 0034 ÷ 002C ÷ 0035 ÷ 0029 ÷ 2296 ÷ 0028 ÷ 0036 ÷ 002C ÷ 0037 ÷ 0029 ÷ +÷ 007B ÷ 0030 ÷ 002C ÷ 0031 ÷ 007D ÷ 002B ÷ 007B ÷ 0032 ÷ 002C ÷ 0033 ÷ 007D ÷ 2295 ÷ 007B ÷ 2212 ÷ 0034 ÷ 002C ÷ 0035 ÷ 007D ÷ 2296 ÷ 007B ÷ 0036 ÷ 002C ÷ 0037 ÷ 007D ÷ +÷ 4F8B ÷ FF1A ÷ 00A3 ÷ 0032 ÷ 0033 ÷ +# Lines: 7 diff --git a/tests/EmojiBreakTest.txt b/tests/EmojiBreakTest.txt index 3840ea1f..d7a482dc 100644 --- a/tests/EmojiBreakTest.txt +++ b/tests/EmojiBreakTest.txt @@ -1,3 +1,6 @@ +# As these sequences are not specified in Unicode, +# may change the test cases if needed. + ÷ 1F3CC × FE0F × 200D × 2642 × FE0F ÷ ÷ 1F3CC × 200D × 2642 ÷ ÷ 1F468 × 200D × 2695 × FE0F ÷ # man health worker diff --git a/tests/testboundaries_ucd.c b/tests/testboundaries_ucd.c index a398287a..08bd2ae7 100644 --- a/tests/testboundaries_ucd.c +++ b/tests/testboundaries_ucd.c @@ -358,6 +358,22 @@ test_emoji_break (void) do_test (filename, bits, FALSE); } +static void +test_char_break (void) +{ + const gchar *filename; + AttrBits bits; + +#if GLIB_CHECK_VERSION(2, 37, 2) + filename = g_test_get_filename (G_TEST_DIST, "CharBreakTest.txt", NULL); +#else + filename = SRCDIR "/CharBreakTest.txt"; +#endif + bits.bits = 0; + bits.attr.is_char_break = 1; + do_test (filename, bits, FALSE); +} + static void test_word_break (void) { @@ -404,7 +420,7 @@ test_line_break (void) bits.bits = 0; bits.attr.is_line_break = 1; bits.attr.is_mandatory_break = 1; - do_test (filename, bits, TRUE); + do_test (filename, bits, FALSE); } @@ -421,6 +437,7 @@ main (gint argc, g_test_add_func ("/text/break/sentence", test_sentence_break); g_test_add_func ("/text/break/line", test_line_break); g_test_add_func ("/text/break/emoji", test_emoji_break); + g_test_add_func ("/text/break/char", test_char_break); return g_test_run (); } -- cgit v1.2.1