| #include <stdplus/str/cat.hpp> |
| #include <stdplus/zstring_view.hpp> |
| |
| #include <string> |
| #include <string_view> |
| |
| #include <gtest/gtest.h> |
| |
| namespace stdplus |
| { |
| |
| using namespace std::string_literals; |
| using namespace std::string_view_literals; |
| |
| TEST(StrCat, NoStr) |
| { |
| EXPECT_EQ("", strCat()); |
| } |
| |
| TEST(StrCat, SingleStr) |
| { |
| EXPECT_EQ("func", strCat("func")); |
| } |
| |
| TEST(StrCat, Multi) |
| { |
| EXPECT_EQ("func world test ff", |
| strCat("func", " world"sv, " test"s, " ff"_zsv)); |
| } |
| |
| TEST(StrCat, MoveStr) |
| { |
| EXPECT_EQ("func", strCat("func"s)); |
| EXPECT_EQ("func world", strCat("func"s, " world")); |
| } |
| |
| } // namespace stdplus |