blob: 8ab4e811987268e500906aa11f8fa2b27264f5b1 [file] [log] [blame]
William A. Kennington III4ef36e72019-06-27 12:48:59 -07001#include <gtest/gtest.h>
2#include <stdplus/util/string.hpp>
3#include <string>
4#include <string_view>
5
6namespace stdplus
7{
8namespace util
9{
10namespace
11{
12
13using namespace std::string_literals;
14using namespace std::string_view_literals;
15
16TEST(StrCat, NoStr)
17{
18 EXPECT_EQ("", strCat());
19}
20
21TEST(StrCat, SingleStr)
22{
23 EXPECT_EQ("func", strCat("func"));
24}
25
26TEST(StrCat, Multi)
27{
28 EXPECT_EQ("func world test", strCat("func", " world"sv, " test"s));
29}
30
31TEST(StrCat, MoveStr)
32{
33 EXPECT_EQ("func", strCat("func"s));
34 EXPECT_EQ("func world", strCat("func"s, " world"));
35}
36
37} // namespace
38} // namespace util
39} // namespace stdplus