Lines Matching refs:StrJoin
39 TEST(StrJoin, APIExamples) { in TEST() argument
43 EXPECT_EQ("foo-bar-baz", absl::StrJoin(v, "-")); in TEST()
49 EXPECT_EQ("foo-bar-baz", absl::StrJoin(v, "-")); in TEST()
55 EXPECT_EQ("foo-bar-baz", absl::StrJoin(v, "-")); in TEST()
62 EXPECT_EQ("foo-bar-baz", absl::StrJoin(v, "-")); in TEST()
68 EXPECT_EQ("1-2-3--4", absl::StrJoin(v, "-")); in TEST()
73 std::string s = absl::StrJoin({"a", "b", "c"}, "-"); in TEST()
78 std::string s = absl::StrJoin(std::make_tuple(123, "abc", 0.456), "-"); in TEST()
88 EXPECT_EQ("1-2-3", absl::StrJoin(v, "-")); in TEST()
94 EXPECT_EQ("1-2-3--4", absl::StrJoin(a, a + ABSL_ARRAYSIZE(a), "-")); in TEST()
101 EXPECT_EQ("1-2-3", absl::StrJoin(v, "-")); in TEST()
109 EXPECT_EQ("1-2-3", absl::StrJoin(v, "-")); in TEST()
116 EXPECT_EQ("a-b", absl::StrJoin(v, "-")); in TEST()
122 EXPECT_EQ("a=1,b=2,c=3", absl::StrJoin(m, ",", absl::PairFormatter("="))); in TEST()
129 EXPECT_EQ("a-b-c-d", absl::StrJoin(absl::StrSplit(s, "="), "-")); in TEST()
139 EXPECT_EQ("", absl::StrJoin(v, "-")); in TEST()
146 EXPECT_EQ("foo", absl::StrJoin(v, "-")); in TEST()
152 EXPECT_EQ("", absl::StrJoin(v, "-")); in TEST()
158 EXPECT_EQ("a-", absl::StrJoin(v, "-")); in TEST()
164 EXPECT_EQ("-", absl::StrJoin(v, "-")); in TEST()
170 EXPECT_EQ("1-0-1", absl::StrJoin(v, "-")); in TEST()
174 TEST(StrJoin, CustomFormatter) { in TEST() argument
178 absl::StrJoin(v, "", [](std::string* out, const std::string& in) { in TEST()
192 EXPECT_EQ("(One)(Two)(Three)", absl::StrJoin(v, "", ImmovableFormatter())); in TEST()
204 EXPECT_EQ("(One)(Two)(Three)", absl::StrJoin(v, "", OverloadedFormatter())); in TEST()
206 EXPECT_EQ("[One][Two][Three]", absl::StrJoin(v, "", fmt)); in TEST()
366 TEST(StrJoin, PublicAPIOverloads) { in TEST() argument
371 absl::StrJoin(v.begin(), v.end(), "-", absl::AlphaNumFormatter())); in TEST()
373 EXPECT_EQ("a-b-c", absl::StrJoin(v, "-", absl::AlphaNumFormatter())); in TEST()
375 EXPECT_EQ("a-b-c", absl::StrJoin(v.begin(), v.end(), "-")); in TEST()
377 EXPECT_EQ("a-b-c", absl::StrJoin(v, "-")); in TEST()
380 TEST(StrJoin, Array) { in TEST() argument
382 EXPECT_EQ("a-b-c", absl::StrJoin(a, "-")); in TEST()
385 TEST(StrJoin, InitializerList) { in TEST() argument
386 { EXPECT_EQ("a-b-c", absl::StrJoin({"a", "b", "c"}, "-")); } in TEST()
390 EXPECT_EQ("a-b-c", absl::StrJoin(a, "-")); in TEST()
395 EXPECT_EQ("a-b-c", absl::StrJoin(a, "-")); in TEST()
400 EXPECT_EQ("a-b-c", absl::StrJoin(a, "-")); in TEST()
405 EXPECT_EQ("a-b-c", absl::StrJoin(a, "-")); in TEST()
412 EXPECT_EQ("(a)-(b)-(c)", absl::StrJoin(a, "-", f)); in TEST()
417 EXPECT_EQ("1-2-3", absl::StrJoin({1, 2, 3}, "-")); in TEST()
424 EXPECT_EQ("(1)-(2)-(3)", absl::StrJoin(a, "-", f)); in TEST()
428 TEST(StrJoin, Tuple) { in TEST() argument
429 EXPECT_EQ("", absl::StrJoin(std::make_tuple(), "-")); in TEST()
430 EXPECT_EQ("hello", absl::StrJoin(std::make_tuple("hello"), "-")); in TEST()
435 EXPECT_EQ("10-hello-3.14", absl::StrJoin(std::make_tuple(x, y, z), "-")); in TEST()
439 absl::StrJoin(std::make_tuple(x, std::cref(y), z), "-")); in TEST()
457 absl::StrJoin(std::make_tuple(x, y, z), "-", TestFormatter())); in TEST()
460 absl::StrJoin(std::make_tuple(x, std::cref(y), z), "-", TestFormatter())); in TEST()
462 absl::StrJoin(std::make_tuple(&x, &y, &z), "-", in TEST()
465 absl::StrJoin(std::make_tuple(absl::make_unique<int>(x), in TEST()
470 absl::StrJoin(std::make_tuple(absl::make_unique<int>(x), &y, &z), in TEST()