summaryrefslogtreecommitdiffstats
path: root/test/test_filesystem.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-18 16:54:14 +0100
committerDavid Robillard <d@drobilla.net>2020-12-18 17:38:43 +0100
commitb58174f0ebe31fb56fe891bfbcf10979079053e3 (patch)
treee951d28c07373cb58bcd1ab901a80d3d30fe64c0 /test/test_filesystem.c
parentb8c3fa9e5476d5d6bb5413f9d52d406475f9e900 (diff)
downloadlilv-b58174f0ebe31fb56fe891bfbcf10979079053e3.tar.gz
lilv-b58174f0ebe31fb56fe891bfbcf10979079053e3.tar.bz2
lilv-b58174f0ebe31fb56fe891bfbcf10979079053e3.zip
Add lilv_path_absolute_child()
Diffstat (limited to 'test/test_filesystem.c')
-rw-r--r--test/test_filesystem.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_filesystem.c b/test/test_filesystem.c
index a3288ed..01ca5ae 100644
--- a/test/test_filesystem.c
+++ b/test/test_filesystem.c
@@ -105,6 +105,26 @@ test_path_absolute(void)
}
static void
+test_path_absolute_child(void)
+{
+ const char* const parent = "/parent";
+ const char* const short_path = "a";
+ const char* const long_path = "a/b/c";
+
+ char* const expected_short = lilv_path_join(parent, short_path);
+ char* const expected_long = lilv_path_join(parent, long_path);
+
+ assert(equals(lilv_path_absolute_child(short_path, parent),
+ expected_short));
+
+ assert(equals(lilv_path_absolute_child(long_path, parent),
+ expected_long));
+
+ free(expected_long);
+ free(expected_short);
+}
+
+static void
test_path_relative_to(void)
{
assert(equals(lilv_path_relative_to("/a/b", "/a/"), "b"));
@@ -478,6 +498,7 @@ main(void)
test_path_is_child();
test_path_current();
test_path_absolute();
+ test_path_absolute_child();
test_path_relative_to();
test_path_parent();
test_path_filename();