diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-03-03 03:46:26 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-03-03 03:46:26 +0000 |
commit | 9be0d6e411c5d4540438fcc8ada287a65b15fb8e (patch) | |
tree | 0474cd99f1a2b5f79352db80d10d3741a0424f01 /tests/markup-parse.c | |
parent | f9e31856f6973a2f9ddb37cd153d413b85719187 (diff) | |
parent | 2ec635ae28261418313156e21b1eeed42d28f056 (diff) | |
download | pango-9be0d6e411c5d4540438fcc8ada287a65b15fb8e.tar.gz |
Merge branch 'markup-parse-fixes' into 'master'
Markup parse fixes
See merge request GNOME/pango!292
Diffstat (limited to 'tests/markup-parse.c')
-rw-r--r-- | tests/markup-parse.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/markup-parse.c b/tests/markup-parse.c index 5f1454a1..9f081ab7 100644 --- a/tests/markup-parse.c +++ b/tests/markup-parse.c @@ -47,11 +47,12 @@ test_file (const gchar *filename, GString *string) gboolean ret; char *str; int start, end; + gunichar accel = 0; g_file_get_contents (filename, &contents, &length, &error); g_assert_no_error (error); - ret = pango_parse_markup (contents, length, 0, &attrs, &text, NULL, &error); + ret = pango_parse_markup (contents, length, '_', &attrs, &text, &accel, &error); g_free (contents); if (ret) @@ -74,6 +75,12 @@ test_file (const gchar *filename, GString *string) pango_attr_list_unref (attrs); pango_font_description_free (desc); g_free (text); + + if (accel) + { + g_string_append (string, "\n\n---\n\n"); + g_string_append_unichar (string, accel); + } } else { @@ -139,20 +146,20 @@ main (int argc, char *argv[]) g_setenv ("LC_ALL", "C", TRUE); setlocale (LC_ALL, ""); - g_test_init (&argc, &argv, NULL); - /* allow to easily generate expected output for new test cases */ - if (argc > 1) + if (argc > 1 && argv[1][0] != '-') { GString *string; string = g_string_sized_new (0); test_file (argv[1], string); - g_test_message ("%s", string->str); + g_print ("%s", string->str); return 0; } + g_test_init (&argc, &argv, NULL); + path = g_test_build_filename (G_TEST_DIST, "markups", NULL); dir = g_dir_open (path, 0, &error); g_free (path); |