diff --git a/support/3rd_party/test/src/utils/path_test.cpp b/support/3rd_party/test/src/utils/path_test.cpp index 52c3b068..f4d3b041 100644 --- a/support/3rd_party/test/src/utils/path_test.cpp +++ b/support/3rd_party/test/src/utils/path_test.cpp @@ -23,7 +23,42 @@ #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()); + EXPECT_EQ(utils::path::backslash_w, utils::path::get_backslash()); +} + +TEST(utils_path, get_dot) { + EXPECT_EQ(utils::path::dot, utils::path::get_dot()); + EXPECT_EQ(utils::path::dot_w, utils::path::get_dot()); +} + TEST(utils_path, combine) { 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()); #endif } -} // namespace fifthgrid +} // namespace repertory