blob: 1633f6e820416e7de0fe4d4b761fc1f0b15f50f7 [file] [log] [blame]
William A. Kennington III4ef36e72019-06-27 12:48:59 -07001#include <gtest/gtest.h>
William A. Kennington III60479702022-12-07 02:55:24 -08002#include <stdplus/str/cat.hpp>
William A. Kennington III4ef36e72019-06-27 12:48:59 -07003#include <string>
4#include <string_view>
5
6namespace stdplus
7{
William A. Kennington III4ef36e72019-06-27 12:48:59 -07008
9using namespace std::string_literals;
10using namespace std::string_view_literals;
11
William A. Kennington III4ef36e72019-06-27 12:48:59 -070012TEST(StrCat, NoStr)
13{
14 EXPECT_EQ("", strCat());
15}
16
17TEST(StrCat, SingleStr)
18{
19 EXPECT_EQ("func", strCat("func"));
20}
21
22TEST(StrCat, Multi)
23{
24 EXPECT_EQ("func world test", strCat("func", " world"sv, " test"s));
25}
26
27TEST(StrCat, MoveStr)
28{
29 EXPECT_EQ("func", strCat("func"s));
30 EXPECT_EQ("func world", strCat("func"s, " world"));
31}
32
William A. Kennington III4ef36e72019-06-27 12:48:59 -070033} // namespace stdplus