diff options
Diffstat (limited to 'test/test_string.c')
-rw-r--r-- | test/test_string.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/test/test_string.c b/test/test_string.c deleted file mode 100644 index e20669d..0000000 --- a/test/test_string.c +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2007-2024 David Robillard <d@drobilla.net> -// SPDX-License-Identifier: ISC - -#undef NDEBUG - -#include "lilv_test_utils.h" - -#include "../src/lilv_internal.h" - -#ifdef _WIN32 -# include <windows.h> -# define setenv(n, v, r) SetEnvironmentVariable((n), (v)) -# define unsetenv(n) SetEnvironmentVariable((n), NULL) -#endif - -#include <assert.h> -#include <stdlib.h> -#include <string.h> - -#ifndef _WIN32 -static void -check_expansion(const char* const path, const char* const expected) -{ - char* const expanded = lilv_expand(path); - assert(!strcmp(expanded, expected)); - free(expanded); -} -#endif - -int -main(void) -{ -#ifndef _WIN32 - setenv("LILV_TEST_1", "test", 1); - - const char* const home = getenv("HOME"); - - check_expansion("$LILV_TEST_1", "test"); - - if (home) { - char* const home_foo = string_concat(home, "/foo"); - check_expansion("~", home); - check_expansion("~foo", "~foo"); - check_expansion("~/foo", home_foo); - free(home_foo); - } - - check_expansion("$NOT_A_VAR", "$NOT_A_VAR"); - - unsetenv("LILV_TEST_1"); -#endif - - return 0; -} |