9 file = g_file_new_for_path ("./some/directory/testfile");
11 s = g_file_get_basename (file);
12 g_assert_cmpstr (s, ==, "testfile");
15 s = g_file_get_uri (file);
16 g_assert (g_str_has_prefix (s, "file://"));
17 g_assert (g_str_has_suffix (s, "/some/directory/testfile"));
20 g_assert (g_file_has_uri_scheme (file, "file"));
21 s = g_file_get_uri_scheme (file);
22 g_assert_cmpstr (s, ==, "file");
25 g_object_unref (file);
36 file = g_file_new_for_path ("./some/directory/testfile");
37 file2 = g_file_new_for_path ("./some/directory");
38 root = g_file_new_for_path ("/");
40 g_assert (g_file_has_parent (file, file2));
42 parent = g_file_get_parent (file);
43 g_assert (g_file_equal (parent, file2));
44 g_object_unref (parent);
46 g_assert (g_file_get_parent (root) == NULL);
48 g_object_unref (file);
49 g_object_unref (file2);
50 g_object_unref (root);
54 main (int argc, char *argv[])
58 g_test_init (&argc, &argv, NULL);
60 g_test_add_func ("/file/basic", test_basic);
61 g_test_add_func ("/file/parent", test_parent);