about summary refs log tree commit diff
path: root/absl/strings/str_split_test.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-06-26T17·45-0700
committerAlex Strelnikov <strel@google.com>2018-06-26T17·49-0400
commit7efd8dc0f1075356e9c7caa950afd1ecf854e8b9 (patch)
tree71d6d8052d98170726835a682463876bcb33f51a /absl/strings/str_split_test.cc
parent87a4c07856e7dc69958019d47b2f02ae47746ec0 (diff)
Export of internal Abseil changes.
--
6bab63b2bcdbd768743c2ebcc4a8e19af20c5406 by Abseil Team <absl-team@google.com>:

Reformats inlined_vector.h to match the current Google lint rules

PiperOrigin-RevId: 202154101

--
00cdeda6ea24591a9cb8ac8b3c2e2a042e1b15b1 by Gennadiy Rozental <rogeeff@google.com>:

Improve SplitterIsConvertibleTo implementation.

PiperOrigin-RevId: 202095009

--
7c24071afac45a17c47e819896f844a36e239bda by Greg Falcon <gfalcon@google.com>:

Internal change

PiperOrigin-RevId: 201991288
GitOrigin-RevId: 6bab63b2bcdbd768743c2ebcc4a8e19af20c5406
Change-Id: Ic5a988ab39e78247285411f36287cd34d6f5afd3
Diffstat (limited to 'absl/strings/str_split_test.cc')
-rw-r--r--absl/strings/str_split_test.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/absl/strings/str_split_test.cc b/absl/strings/str_split_test.cc
index c172a7629933..c6898863dc0e 100644
--- a/absl/strings/str_split_test.cc
+++ b/absl/strings/str_split_test.cc
@@ -37,6 +37,34 @@ using ::testing::ElementsAre;
 using ::testing::Pair;
 using ::testing::UnorderedElementsAre;
 
+TEST(Split, TraitsTest) {
+  static_assert(!absl::strings_internal::SplitterIsConvertibleTo<int>::value,
+                "");
+  static_assert(!absl::strings_internal::SplitterIsConvertibleTo<std::string>::value,
+                "");
+  static_assert(absl::strings_internal::SplitterIsConvertibleTo<
+                    std::vector<std::string>>::value,
+                "");
+  static_assert(
+      !absl::strings_internal::SplitterIsConvertibleTo<std::vector<int>>::value,
+      "");
+  static_assert(absl::strings_internal::SplitterIsConvertibleTo<
+                    std::vector<absl::string_view>>::value,
+                "");
+  static_assert(absl::strings_internal::SplitterIsConvertibleTo<
+                    std::map<std::string, std::string>>::value,
+                "");
+  static_assert(absl::strings_internal::SplitterIsConvertibleTo<
+                    std::map<absl::string_view, absl::string_view>>::value,
+                "");
+  static_assert(!absl::strings_internal::SplitterIsConvertibleTo<
+                    std::map<int, std::string>>::value,
+                "");
+  static_assert(!absl::strings_internal::SplitterIsConvertibleTo<
+                    std::map<std::string, int>>::value,
+                "");
+}
+
 // This tests the overall split API, which is made up of the absl::StrSplit()
 // function and the Delimiter objects in the absl:: namespace.
 // This TEST macro is outside of any namespace to require full specification of