updated build system
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
@ -57,6 +57,11 @@ TEST(utils_path, constants) {
|
||||
EXPECT_EQ(std::wstring_view{L"./"}, utils::path::dot_slash_w);
|
||||
EXPECT_EQ(std::string_view{"/"}, utils::path::slash);
|
||||
EXPECT_EQ(std::wstring_view{L"/"}, utils::path::slash_w);
|
||||
|
||||
#if defined(_WIN32)
|
||||
EXPECT_EQ(std::string_view{"\\\\"}, utils::path::unc_notation);
|
||||
EXPECT_EQ(std::wstring_view{L"\\\\"}, utils::path::unc_notation_w);
|
||||
#endif // defined(_WIN32)
|
||||
}
|
||||
|
||||
TEST(utils_path, directory_seperator) {
|
||||
@ -171,6 +176,9 @@ TEST(utils_path, combine) {
|
||||
|
||||
s = utils::path::combine("R:", {"\\"});
|
||||
EXPECT_STREQ(test_path("r:").c_str(), s.c_str());
|
||||
|
||||
s = utils::path::combine("\\\\moose", {"cow"});
|
||||
EXPECT_STREQ("\\\\moose\\cow", s.c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -276,14 +284,14 @@ TEST(utils_path, finalize) {
|
||||
|
||||
s = utils::path::finalize(R"(\\)");
|
||||
#if defined(_WIN32)
|
||||
EXPECT_STREQ(test_path(R"(\)").c_str(), s.c_str());
|
||||
EXPECT_STREQ("\\\\", s.c_str());
|
||||
#else
|
||||
EXPECT_STREQ("/", s.c_str());
|
||||
#endif
|
||||
|
||||
s = utils::path::finalize("//");
|
||||
#if defined(_WIN32)
|
||||
EXPECT_STREQ(test_path(R"(\)").c_str(), s.c_str());
|
||||
EXPECT_STREQ("\\\\", s.c_str());
|
||||
#else
|
||||
EXPECT_STREQ("/", s.c_str());
|
||||
#endif
|
||||
@ -330,6 +338,18 @@ TEST(utils_path, finalize) {
|
||||
|
||||
s = utils::path::finalize("D:/moose/");
|
||||
EXPECT_STREQ(test_path("d:\\moose").c_str(), s.c_str());
|
||||
|
||||
s = utils::path::finalize("\\\\moose\\cow");
|
||||
EXPECT_STREQ("\\\\moose\\cow", s.c_str());
|
||||
|
||||
s = utils::path::finalize("//moose/cow");
|
||||
EXPECT_STREQ("\\\\moose\\cow", s.c_str());
|
||||
#else // !defined(_WIN32)
|
||||
s = utils::path::finalize("\\\\moose\\cow");
|
||||
EXPECT_STREQ("/moose/cow", s.c_str());
|
||||
|
||||
s = utils::path::finalize("//moose/cow");
|
||||
EXPECT_STREQ("/moose/cow", s.c_str());
|
||||
#endif // defined(_WIN32)
|
||||
}
|
||||
|
||||
@ -351,6 +371,12 @@ TEST(utils_path, absolute) {
|
||||
path = utils::path::absolute(R"(./moose)");
|
||||
EXPECT_STREQ((dir + R"(\moose)").c_str(), path.c_str());
|
||||
|
||||
path = utils::path::absolute(R"(\\server\share)");
|
||||
EXPECT_STREQ(R"(\\server\share)", path.c_str());
|
||||
|
||||
path = utils::path::absolute(R"(//server/share)");
|
||||
EXPECT_STREQ(R"(\\server\share)", path.c_str());
|
||||
|
||||
auto home_env = utils::get_environment_variable("USERPROFILE");
|
||||
#else // !defined(_WIN32)
|
||||
path = utils::path::absolute(R"(.\moose)");
|
||||
@ -359,6 +385,9 @@ TEST(utils_path, absolute) {
|
||||
path = utils::path::absolute(R"(./moose)");
|
||||
EXPECT_STREQ((dir + R"(/moose)").c_str(), path.c_str());
|
||||
|
||||
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);
|
||||
|
Reference in New Issue
Block a user