summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-09 07:12:34 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-07-09 07:14:07 -0400
commitcbeaceced0cc728312ed834a2f4f41fa6a68fd01 (patch)
tree53c63c62e22fede40186a5cdd5addf09c0be1c74 /tests
parentf3aec778e817f685498e949663c67b72f27e0308 (diff)
downloadpango-cbeaceced0cc728312ed834a2f4f41fa6a68fd01.tar.gz
Add a testcase for pango_attr_list_changetest-for-564
This recreates the scenario described in #564. It works fine.
Diffstat (limited to 'tests')
-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);