updated build system
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
parent
7fcc40d0e1
commit
e7b576bc45
39
support/3rd_party/test/src/utils/path_test.cpp
vendored
39
support/3rd_party/test/src/utils/path_test.cpp
vendored
@ -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<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) {
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user