diff options
author | David Robillard <d@drobilla.net> | 2020-08-06 16:37:01 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-07 01:30:23 +0200 |
commit | 18eba7b656ab19e27c2351e63a9990b570417b8f (patch) | |
tree | 1f0a8587688655a3e1039df125a6fac290d5b224 /test/test_string.c | |
parent | 64fbc5533bbb85ee9b35b44ac240d75be9f8e267 (diff) | |
download | lilv-18eba7b656ab19e27c2351e63a9990b570417b8f.tar.gz lilv-18eba7b656ab19e27c2351e63a9990b570417b8f.tar.bz2 lilv-18eba7b656ab19e27c2351e63a9990b570417b8f.zip |
Add filesystem tests
Diffstat (limited to 'test/test_string.c')
-rw-r--r-- | test/test_string.c | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/test/test_string.c b/test/test_string.c index d782c08..9eb2456 100644 --- a/test/test_string.c +++ b/test/test_string.c @@ -18,7 +18,6 @@ #undef NDEBUG -#include "../src/filesystem.h" #include "../src/lilv_internal.h" #ifdef _WIN32 @@ -34,47 +33,9 @@ int main(void) { +#ifndef _WIN32 char* s = NULL; - assert(!strcmp((s = lilv_path_parent("/foo/bar")), "/foo")); - free(s); - assert(!strcmp((s = lilv_path_parent("/foo/bar/")), "/foo")); - free(s); - assert(!strcmp((s = lilv_path_parent("/foo///bar/")), "/foo")); - free(s); - assert(!strcmp((s = lilv_path_parent("/foo///bar//")), "/foo")); - free(s); - assert(!strcmp((s = lilv_path_parent("foo")), ".")); - free(s); - assert(!strcmp((s = lilv_path_parent("/foo")), "/")); - free(s); - assert(!strcmp((s = lilv_path_parent("/")), "/")); - free(s); - assert(!strcmp((s = lilv_path_parent("//")), "/")); - free(s); - assert(!strcmp((s = lilv_path_relative_to("/a/b", "/a/")), "b")); - free(s); - assert(!strcmp((s = lilv_path_relative_to("/a", "/b/c/")), "/a")); - free(s); - assert(!strcmp((s = lilv_path_relative_to("/a/b/c", "/a/b/d/")), "../c")); - free(s); - assert( - !strcmp((s = lilv_path_relative_to("/a/b/c", "/a/b/d/e/")), "../../c")); - free(s); - assert(!strcmp((s = lilv_path_join("/a", "b")), "/a/b")); - free(s); - assert(!strcmp((s = lilv_path_join("/a", "/b")), "/a/b")); - free(s); - assert(!strcmp((s = lilv_path_join("/a/", "/b")), "/a/b")); - free(s); - assert(!strcmp((s = lilv_path_join("/a/", "b")), "/a/b")); - free(s); - assert(!strcmp((s = lilv_path_join("/a", NULL)), "/a/")); - free(s); - assert(!strcmp((s = lilv_path_join(NULL, "/b")), "/b")); - free(s); - -#ifndef _WIN32 setenv("LILV_TEST_1", "test", 1); char* home_foo = lilv_strjoin(getenv("HOME"), "/foo", NULL); assert(!strcmp((s = lilv_expand("$LILV_TEST_1")), "test")); |