]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/path/test/run-join.c
tal/path: handle weird case of path_join("")
[ccan] / ccan / tal / path / test / run-join.c
index 3961cbb132401bd6a68f5ae4d5c4df5fb3922e12..05d3d6e1ea7312720e32469849f100dad04c21b7 100644 (file)
@@ -6,7 +6,7 @@ int main(void)
 {
        char *path, *ctx = tal_strdup(NULL, "ctx");
 
-       plan_tests(34);
+       plan_tests(36);
 
        path = path_join(ctx, "foo", "bar");
        ok1(streq(path, "foo/bar"));
@@ -85,6 +85,11 @@ int main(void)
        ok1(!path);
        ok1(!tal_first(ctx));
 
+       path = path_join(ctx, "", "bar");
+       ok1(streq(path, "bar"));
+       ok1(tal_parent(path) == ctx);
+       tal_free(path);
+
        tal_free(ctx);
 
        return exit_status();