summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-09 12:09:20 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-07-09 12:09:20 +0000
commit94988869c360d0b6ee9dc2e55b4179d2fd6920e6 (patch)
treefa8c455dd815af05464b59bcc4ea2fd11ea5c655
parent2834f68ad5ecf3b82e442323782a1292bb06062e (diff)
parentcbeaceced0cc728312ed834a2f4f41fa6a68fd01 (diff)
downloadpango-94988869c360d0b6ee9dc2e55b4179d2fd6920e6.tar.gz
Merge branch 'test-for-564' into 'master'
Add a testcase for pango_attr_list_change See merge request GNOME/pango!364
-rw-r--r--tests/testattributes.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/testattributes.c b/tests/testattributes.c
index 26277b56..849e47cb 100644
--- a/tests/testattributes.c
+++ b/tests/testattributes.c
@@ -258,6 +258,27 @@ test_list_change (void)
pango_attr_list_unref (list);
}
+/* See https://gitlab.gnome.org/GNOME/pango/-/issues/564 */
+static void
+test_list_change2 (void)
+{
+ PangoAttrList *list;
+ PangoAttribute *attr;
+
+ list = attributes_from_string ("[6,11]weight=700\n"
+ "[18,23]weight=700\n");
+
+ /* insertion with joining */
+ attr = pango_attr_weight_new (700);
+ attr->start_index = 0;
+ attr->end_index = 29;
+ pango_attr_list_change (list, attr);
+
+ assert_attr_list (list, "[0,29]weight=700\n");
+
+ pango_attr_list_unref (list);
+}
+
static void
test_list_splice (void)
{
@@ -1003,6 +1024,7 @@ main (int argc, char *argv[])
g_test_add_func ("/attributes/register", test_attributes_register);
g_test_add_func ("/attributes/list/basic", test_list);
g_test_add_func ("/attributes/list/change", test_list_change);
+ g_test_add_func ("/attributes/list/change2", test_list_change2);
g_test_add_func ("/attributes/list/splice", test_list_splice);
g_test_add_func ("/attributes/list/splice2", test_list_splice2);
g_test_add_func ("/attributes/list/splice3", test_list_splice3);