updated build system
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
44
support/3rd_party/test/src/utils/path_test.cpp
vendored
44
support/3rd_party/test/src/utils/path_test.cpp
vendored
@@ -119,6 +119,47 @@ TEST(utils_path, combine) {
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(utils_path, format_path) {
|
||||
std::string path{"\\"};
|
||||
utils::path::format_path(path, utils::path::directory_seperator,
|
||||
utils::path::not_directory_seperator);
|
||||
EXPECT_STREQ("/", path.c_str());
|
||||
|
||||
path = "\\\\";
|
||||
utils::path::format_path(path, utils::path::directory_seperator,
|
||||
utils::path::not_directory_seperator);
|
||||
EXPECT_STREQ("/", path.c_str());
|
||||
|
||||
path = "\\\\\\";
|
||||
utils::path::format_path(path, utils::path::directory_seperator,
|
||||
utils::path::not_directory_seperator);
|
||||
EXPECT_STREQ("/", path.c_str());
|
||||
|
||||
path = "\\\\\\\\";
|
||||
utils::path::format_path(path, utils::path::directory_seperator,
|
||||
utils::path::not_directory_seperator);
|
||||
EXPECT_STREQ("/", path.c_str());
|
||||
|
||||
path = "/";
|
||||
utils::path::format_path(path, utils::path::directory_seperator,
|
||||
utils::path::not_directory_seperator);
|
||||
EXPECT_STREQ("/", path.c_str());
|
||||
path = "//";
|
||||
utils::path::format_path(path, utils::path::directory_seperator,
|
||||
utils::path::not_directory_seperator);
|
||||
EXPECT_STREQ("/", path.c_str());
|
||||
|
||||
path = "///";
|
||||
utils::path::format_path(path, utils::path::directory_seperator,
|
||||
utils::path::not_directory_seperator);
|
||||
EXPECT_STREQ("/", path.c_str());
|
||||
|
||||
path = "////";
|
||||
utils::path::format_path(path, utils::path::directory_seperator,
|
||||
utils::path::not_directory_seperator);
|
||||
EXPECT_STREQ("/", path.c_str());
|
||||
}
|
||||
|
||||
TEST(utils_path, create_api_path) {
|
||||
auto s = utils::path::create_api_path("");
|
||||
EXPECT_STREQ("/", s.c_str());
|
||||
@@ -132,6 +173,9 @@ TEST(utils_path, create_api_path) {
|
||||
s = utils::path::create_api_path(".");
|
||||
EXPECT_STREQ("/", s.c_str());
|
||||
|
||||
s = utils::path::create_api_path("./");
|
||||
EXPECT_STREQ("/", s.c_str());
|
||||
|
||||
s = utils::path::create_api_path(R"(\\)");
|
||||
EXPECT_STREQ("/", s.c_str());
|
||||
|
||||
|
Reference in New Issue
Block a user