summaryrefslogtreecommitdiff
path: root/tests/test-common.c
diff options
context:
space:
mode:
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)
{