summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-11-03 16:12:54 +0800
committerMichael Catanzaro <mcatanzaro@igalia.com>2017-11-15 10:27:56 -0600
commite6f63d744787d473083adbe9f6c0d0e91d47a121 (patch)
treee9c8b4816671c5f814b7fc9089f83cd5143b3f1d /tests
parente8316c1c6f46b844b265478622d3a581305b70b6 (diff)
downloadpango-e6f63d744787d473083adbe9f6c0d0e91d47a121.tar.gz
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
Diffstat (limited to 'tests')
-rw-r--r--tests/CharBreakTest.txt11
-rw-r--r--tests/EmojiBreakTest.txt3
-rw-r--r--tests/testboundaries_ucd.c19
3 files changed, 32 insertions, 1 deletions
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
@@ -359,6 +359,22 @@ test_emoji_break (void)
}
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)
{
const gchar *filename;
@@ -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 ();
}