summaryrefslogtreecommitdiff
path: root/tests/test-common.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-06-26 14:51:56 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-06-28 00:05:09 -0400
commit400488579d0b0a651f3090517f12399a9030f4fa (patch)
tree27f0bdbad870fde62ac2dfb63944b498d0827ae4 /tests/test-common.c
parent0dd8fc513016915e78728fa9a75343c4e41d848f (diff)
downloadpango-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.c19
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)
{