blob: 758faccb9845b06c3cf0632ce317396b60ad1b56 [file] [log] [blame]
William A. Kennington III60479702022-12-07 02:55:24 -08001#include <stdplus/str/cat.hpp>
Patrick Williamsd1984dd2023-05-10 16:12:44 -05002
William A. Kennington III4ef36e72019-06-27 12:48:59 -07003#include <string>
4#include <string_view>
5
Patrick Williamsd1984dd2023-05-10 16:12:44 -05006#include <gtest/gtest.h>
7
William A. Kennington III4ef36e72019-06-27 12:48:59 -07008namespace stdplus
9{
William A. Kennington III4ef36e72019-06-27 12:48:59 -070010
11using namespace std::string_literals;
12using namespace std::string_view_literals;
13
William A. Kennington III4ef36e72019-06-27 12:48:59 -070014TEST(StrCat, NoStr)
15{
16 EXPECT_EQ("", strCat());
17}
18
19TEST(StrCat, SingleStr)
20{
21 EXPECT_EQ("func", strCat("func"));
22}
23
24TEST(StrCat, Multi)
25{
26 EXPECT_EQ("func world test", strCat("func", " world"sv, " test"s));
27}
28
29TEST(StrCat, MoveStr)
30{
31 EXPECT_EQ("func", strCat("func"s));
32 EXPECT_EQ("func world", strCat("func"s, " world"));
33}
34
William A. Kennington III4ef36e72019-06-27 12:48:59 -070035} // namespace stdplus