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:
16
support/3rd_party/test/src/utils/path_test.cpp
vendored
16
support/3rd_party/test/src/utils/path_test.cpp
vendored
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "utils/common.hpp"
|
||||
#include "utils/path.hpp"
|
||||
#include "utils/string.hpp"
|
||||
|
||||
@@ -245,4 +246,19 @@ TEST(utils_path, finalize) {
|
||||
EXPECT_STREQ("/cow/moose/dog/chicken", s.c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(utils_path, absolute) {
|
||||
auto dir = utils::path::absolute(std::filesystem::current_path().string());
|
||||
auto path = utils::path::absolute(".");
|
||||
EXPECT_STREQ(dir.c_str(), path.c_str());
|
||||
|
||||
path = utils::path::absolute("./");
|
||||
EXPECT_STREQ(dir.c_str(), path.c_str());
|
||||
|
||||
auto home = utils::path::absolute(utils::get_environment_variable("HOME"));
|
||||
path = utils::path::absolute("~");
|
||||
EXPECT_STREQ(home.c_str(), path.c_str());
|
||||
|
||||
// path = utils::path::absolute("~/.local");
|
||||
}
|
||||
} // namespace repertory
|
||||
|
@@ -82,6 +82,14 @@ TEST(utils_string, replace) {
|
||||
std::wstring str_w3{L"///"};
|
||||
utils::string::replace(str_w3, '/', '\\');
|
||||
EXPECT_STREQ(L"\\\\\\", str_w3.c_str());
|
||||
|
||||
str.clear();
|
||||
utils::string::replace(str, '/', '\\');
|
||||
EXPECT_STREQ("", str.c_str());
|
||||
|
||||
str_w.clear();
|
||||
utils::string::replace(str_w, '/', '\\');
|
||||
EXPECT_STREQ(L"", str_w.c_str());
|
||||
}
|
||||
|
||||
TEST(utils_string, replace_string) {
|
||||
|
Reference in New Issue
Block a user