updated build system
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
2024-08-02 22:34:01 -05:00
parent 99c0246720
commit d659a5e04d
3 changed files with 50 additions and 17 deletions

View File

@@ -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

View File

@@ -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) {