updated build system
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit

This commit is contained in:
2024-08-02 18:45:17 -05:00
parent dd492ff52d
commit a3e578240b
2 changed files with 78 additions and 23 deletions

View File

@@ -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());