2007-04-23 Jonathan Chambers <joncham@gmail.com>
[mono.git] / eglib / test / path.c
index 07c73f608ee9123deb51ff35cb37c128d776454d..e6731ad0f13dc63ea71ccbb3edcdf3bedd4076e7 100644 (file)
@@ -77,6 +77,12 @@ test_buildpath ()
        if (strcmp (s, "a/b/c/d") != 0)
                return FAILED ("13 Got wrong result, got: %s", s);
        g_free (s);
+
+       s = g_build_path ("/", "/a", "", "/c/", NULL);
+       if (strcmp (s, "/a/c/") != 0)
+               return FAILED ("14 Got wrong result, got: %s", s);
+       g_free (s);
+        return OK;
        
        return OK;
 }
@@ -108,6 +114,15 @@ test_dirname ()
        if (strcmp (s, "/home/dingus") != 0)
                return FAILED ("Expected /home/dingus, got %s", s);
        g_free (s);
+
+       s = g_path_get_dirname ("dir.c");
+       if (strcmp (s, ".") != 0)
+               return FAILED ("Expected `.', got %s", s);
+       g_free (s);
+
+       s = g_path_get_dirname ("/index.html");
+       if (strcmp (s, "/") != 0)
+               return FAILED ("Expected [/], got [%s]", s);
        
        return OK;
 }