aboutsummaryrefslogtreecommitdiffstats
path: root/src/gmock-matchers.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gmock-matchers.cc')
-rw-r--r--src/gmock-matchers.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/gmock-matchers.cc b/src/gmock-matchers.cc
index 63f3859b..5f746b95 100644
--- a/src/gmock-matchers.cc
+++ b/src/gmock-matchers.cc
@@ -63,6 +63,41 @@ Matcher<internal::string>::Matcher(const char* s) {
*this = Eq(internal::string(s));
}
+#if GTEST_HAS_STRING_PIECE_
+// Constructs a matcher that matches a const StringPiece& whose value is
+// equal to s.
+Matcher<const StringPiece&>::Matcher(const internal::string& s) {
+ *this = Eq(s);
+}
+
+// Constructs a matcher that matches a const StringPiece& whose value is
+// equal to s.
+Matcher<const StringPiece&>::Matcher(const char* s) {
+ *this = Eq(internal::string(s));
+}
+
+// Constructs a matcher that matches a const StringPiece& whose value is
+// equal to s.
+Matcher<const StringPiece&>::Matcher(StringPiece s) {
+ *this = Eq(s.ToString());
+}
+
+// Constructs a matcher that matches a StringPiece whose value is equal to s.
+Matcher<StringPiece>::Matcher(const internal::string& s) {
+ *this = Eq(s);
+}
+
+// Constructs a matcher that matches a StringPiece whose value is equal to s.
+Matcher<StringPiece>::Matcher(const char* s) {
+ *this = Eq(internal::string(s));
+}
+
+// Constructs a matcher that matches a StringPiece whose value is equal to s.
+Matcher<StringPiece>::Matcher(StringPiece s) {
+ *this = Eq(s.ToString());
+}
+#endif // GTEST_HAS_STRING_PIECE_
+
namespace internal {
// Joins a vector of strings as if they are fields of a tuple; returns