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

This commit is contained in:
Scott E. Graves 2024-08-02 16:33:52 -05:00
parent 7fcc40d0e1
commit e7b576bc45

View File

@ -23,7 +23,42 @@
#include "utils/path.hpp" #include "utils/path.hpp"
namespace fifthgrid { namespace repertory {
TEST(utils_path, constants) {
EXPECT_EQ(std::string_view{"\\"}, utils::path::backslash);
EXPECT_EQ(std::wstring_view{L"\\"}, utils::path::backslash_w);
EXPECT_EQ(std::string_view{"."}, utils::path::dot);
EXPECT_EQ(std::wstring_view{L"."}, utils::path::dot_w);
EXPECT_EQ(std::string_view{"./"}, utils::path::dot_slash);
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);
}
TEST(utils_path, directory_seperator) {
#if defined(_WIN32)
EXPECT_EQ(utils::path::backslash, utils::path::directory_seperator);
EXPECT_EQ(utils::path::backslash_w, utils::path::directory_seperator_w);
EXPECT_EQ(utils::path::slash, utils::path::not_directory_seperator);
EXPECT_EQ(utils::path::slash_w, utils::path::not_directory_seperator_w);
#else // !defined(_WIN32)
EXPECT_EQ(utils::path::slash, utils::path::directory_seperator);
EXPECT_EQ(utils::path::slash_w, utils::path::directory_seperator_w);
EXPECT_EQ(utils::path::backslash, utils::path::not_directory_seperator);
EXPECT_EQ(utils::path::backslash_w, utils::path::not_directory_seperator_w);
#endif // defined(_WIN32)
}
TEST(utils_path, get_backslash) {
EXPECT_EQ(utils::path::backslash, utils::path::get_backslash<char>());
EXPECT_EQ(utils::path::backslash_w, utils::path::get_backslash<wchar_t>());
}
TEST(utils_path, get_dot) {
EXPECT_EQ(utils::path::dot, utils::path::get_dot<char>());
EXPECT_EQ(utils::path::dot_w, utils::path::get_dot<wchar_t>());
}
TEST(utils_path, combine) { TEST(utils_path, combine) {
auto s = utils::path::combine(R"(\test\path)", {}); auto s = utils::path::combine(R"(\test\path)", {});
@ -130,4 +165,4 @@ TEST(utils_path, finalize) {
EXPECT_STREQ("/cow/moose/dog/chicken", s.c_str()); EXPECT_STREQ("/cow/moose/dog/chicken", s.c_str());
#endif #endif
} }
} // namespace fifthgrid } // namespace repertory