updated build system
This commit is contained in:
@ -387,16 +387,7 @@ TEST(utils_path, absolute) {
|
||||
|
||||
path = utils::path::absolute(R"(\\server\share)");
|
||||
EXPECT_STREQ(R"(/server/share)", path.c_str());
|
||||
|
||||
auto home_env = utils::get_environment_variable("HOME");
|
||||
#endif // defined(_WIN32)
|
||||
auto home = utils::path::absolute(home_env);
|
||||
|
||||
path = utils::path::absolute("~/");
|
||||
EXPECT_STREQ(home.c_str(), path.c_str());
|
||||
|
||||
path = utils::path::absolute("~\\");
|
||||
EXPECT_STREQ(home.c_str(), path.c_str());
|
||||
}
|
||||
|
||||
TEST(utils_path, absolute_can_resolve_path_variables) {
|
||||
@ -411,19 +402,20 @@ TEST(utils_path, absolute_can_resolve_path_variables) {
|
||||
static_cast<DWORD>(home.size()));
|
||||
home = utils::path::absolute(home);
|
||||
|
||||
auto expanded_str = utils::path::absolute("%USERPROFILE%");
|
||||
EXPECT_STREQ(home.c_str(), expanded_str.c_str());
|
||||
|
||||
expanded_str = utils::path::absolute("~\\");
|
||||
EXPECT_STREQ(home.c_str(), expanded_str.c_str());
|
||||
EXPECT_STREQ((home + home).c_str(), expanded_str.c_str());
|
||||
EXPECT_STREQ(home.c_str(), utils::path::absolute("%USERPROFILE%").c_str());
|
||||
#else // !defined(_WIN32)
|
||||
home = std::getenv("HOME");
|
||||
home = utils::path::absolute(home);
|
||||
|
||||
auto expanded_str = utils::path::absolute("~/");
|
||||
EXPECT_STREQ(home.c_str(), expanded_str.c_str());
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
auto expanded_str = utils::path::absolute("~\\");
|
||||
EXPECT_STREQ(home.c_str(), expanded_str.c_str());
|
||||
|
||||
expanded_str = utils::path::absolute("~/");
|
||||
EXPECT_STREQ(home.c_str(), expanded_str.c_str());
|
||||
|
||||
expanded_str = utils::path::absolute("~");
|
||||
EXPECT_STREQ("~", expanded_str.c_str());
|
||||
}
|
||||
|
||||
TEST(utils_path, get_parent_path) {
|
||||
|
Reference in New Issue
Block a user