updated build system

This commit is contained in:
2024-10-10 08:30:53 -05:00
parent 9aafb62961
commit 9c01d51334
3 changed files with 13 additions and 10 deletions

View File

@ -72,7 +72,7 @@ auto absolute(std::string_view path) -> std::string {
return abs_path;
}
abs_path = finalize(resolve(abs_path));
abs_path = resolve(finalize(abs_path));
#if defined(_WIN32)
if (not utils::string::contains(abs_path, dot)) {
return abs_path;

View File

@ -392,7 +392,10 @@ TEST(utils_path, absolute) {
#endif // defined(_WIN32)
auto home = utils::path::absolute(home_env);
path = utils::path::absolute("~");
path = utils::path::absolute("~/");
EXPECT_STREQ(home.c_str(), path.c_str());
path = utils::path::absolute("~\\");
EXPECT_STREQ(home.c_str(), path.c_str());
}
@ -411,14 +414,14 @@ TEST(utils_path, absolute_can_resolve_path_variables) {
auto expanded_str = utils::path::absolute("%USERPROFILE%");
EXPECT_STREQ(home.c_str(), expanded_str.c_str());
expanded_str = utils::path::absolute("~");
expanded_str = utils::path::absolute("~\\");
EXPECT_STREQ(home.c_str(), expanded_str.c_str());
EXPECT_STREQ((home + home).c_str(), expanded_str.c_str());
#else // !defined(_WIN32)
home = std::getenv("HOME");
home = utils::path::absolute(home);
auto expanded_str = utils::path::absolute("~");
auto expanded_str = utils::path::absolute("~/");
EXPECT_STREQ(home.c_str(), expanded_str.c_str());
#endif // defined(_WIN32)
}