diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-06-26 14:51:56 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-06-28 00:05:09 -0400 |
commit | 400488579d0b0a651f3090517f12399a9030f4fa (patch) | |
tree | 27f0bdbad870fde62ac2dfb63944b498d0827ae4 /tests/test-common.c | |
parent | 0dd8fc513016915e78728fa9a75343c4e41d848f (diff) | |
download | pango-400488579d0b0a651f3090517f12399a9030f4fa.tar.gz |
tests: Improve markup test coverage
Cover many more error cases.
Diffstat (limited to 'tests/test-common.c')
-rw-r--r-- | tests/test-common.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test-common.c b/tests/test-common.c index 18ee4a40..a6339415 100644 --- a/tests/test-common.c +++ b/tests/test-common.c @@ -81,6 +81,25 @@ done: return diff; } +gboolean +file_has_prefix (const char *filename, + const char *str, + GError **error) +{ + char *contents; + gsize len; + gboolean ret; + + if (!g_file_get_contents (filename, &contents, &len, error)) + return FALSE; + + ret = g_str_has_prefix (contents, str); + + g_free (contents); + + return ret; +} + void print_attribute (PangoAttribute *attr, GString *string) { |