summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-01-07 21:26:14 -0500
committerMatthias Clasen <mclasen@redhat.com>2022-01-07 21:39:39 -0500
commitd04872ad221b56f80ff20503816fde4dd10636c6 (patch)
treebdce2d05fb3a3e3b7304764bea1f59288378b012 /tests
parent65d2e49cebe4a09fba60f612fd343f9d9f008c1c (diff)
downloadpango-d04872ad221b56f80ff20503816fde4dd10636c6.tar.gz
Reinstate previous behavior or pango_attr_list_spliceattrlist-splice
If gap is zero, don't limit the inserted attributes; that does not make sense. Spell out the different use cases in the docs. Testcase included. Fixes: #653
Diffstat (limited to 'tests')
-rw-r--r--tests/testattributes.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/testattributes.c b/tests/testattributes.c
index cd70edc8..d396269f 100644
--- a/tests/testattributes.c
+++ b/tests/testattributes.c
@@ -1338,6 +1338,23 @@ test_iter_epsilon_zero (void)
g_string_free (s, TRUE);
}
+static void
+test_gnumeric_splice (void)
+{
+ PangoAttrList *list, *list2;
+
+ list = pango_attr_list_from_string ("0 -1 font-desc \"Sans 10\"\n");
+ list2 = pango_attr_list_from_string ("1 2 weight bold\n");
+
+ pango_attr_list_splice (list, list2, 0, 0);
+
+ assert_attr_list (list, "0 4294967295 font-desc \"Sans 10\"\n"
+ "1 2 weight bold\n");
+
+ pango_attr_list_unref (list);
+ pango_attr_list_unref (list2);
+}
+
int
main (int argc, char *argv[])
{
@@ -1377,6 +1394,7 @@ main (int argc, char *argv[])
g_test_add_func ("/attributes/iter/get_font", test_iter_get_font);
g_test_add_func ("/attributes/iter/get_attrs", test_iter_get_attrs);
g_test_add_func ("/attributes/iter/epsilon_zero", test_iter_epsilon_zero);
+ g_test_add_func ("/attributes/gnumeric-splice", test_gnumeric_splice);
return g_test_run ();
}