diff options
author | Tanzinul Islam <t_17_7@hotmail.com> | 2018-05-05 19:53:33 +0100 |
---|---|---|
committer | Tanzinul Islam <t_17_7@hotmail.com> | 2018-05-05 19:53:33 +0100 |
commit | 10f05a627c2da8d7de78da1b08f984ce8de398fb (patch) | |
tree | 4f799952ac6fa35647a653cc12caf42efd73e005 /googlemock/src/gmock-matchers.cc | |
parent | 5c7c365d5f3e5467de350f2e81a31407a3f52505 (diff) | |
parent | 278aba369c41e90e9e77a6f51443beb3692919cf (diff) | |
download | googletest-10f05a627c2da8d7de78da1b08f984ce8de398fb.tar.gz googletest-10f05a627c2da8d7de78da1b08f984ce8de398fb.tar.bz2 googletest-10f05a627c2da8d7de78da1b08f984ce8de398fb.zip |
Merge branch 'master' into fix_death_test_child_mingw_wer_issue1116
Diffstat (limited to 'googlemock/src/gmock-matchers.cc')
-rw-r--r-- | googlemock/src/gmock-matchers.cc | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/googlemock/src/gmock-matchers.cc b/googlemock/src/gmock-matchers.cc index a5ed686e..194d992d 100644 --- a/googlemock/src/gmock-matchers.cc +++ b/googlemock/src/gmock-matchers.cc @@ -105,6 +105,53 @@ Matcher<::string>::Matcher(const ::string& s) { *this = Eq(s); } Matcher<::string>::Matcher(const char* s) { *this = Eq(::string(s)); } #endif // GTEST_HAS_GLOBAL_STRING +#if GTEST_HAS_ABSL +// Constructs a matcher that matches a const absl::string_view& whose value is +// equal to s. +Matcher<const absl::string_view&>::Matcher(const std::string& s) { + *this = Eq(s); +} + +#if GTEST_HAS_GLOBAL_STRING +// Constructs a matcher that matches a const absl::string_view& whose value is +// equal to s. +Matcher<const absl::string_view&>::Matcher(const ::string& s) { *this = Eq(s); } +#endif // GTEST_HAS_GLOBAL_STRING + +// Constructs a matcher that matches a const absl::string_view& whose value is +// equal to s. +Matcher<const absl::string_view&>::Matcher(const char* s) { + *this = Eq(std::string(s)); +} + +// Constructs a matcher that matches a const absl::string_view& whose value is +// equal to s. +Matcher<const absl::string_view&>::Matcher(absl::string_view s) { + *this = Eq(std::string(s)); +} + +// Constructs a matcher that matches a absl::string_view whose value is equal to +// s. +Matcher<absl::string_view>::Matcher(const std::string& s) { *this = Eq(s); } + +#if GTEST_HAS_GLOBAL_STRING +// Constructs a matcher that matches a absl::string_view whose value is equal to +// s. +Matcher<absl::string_view>::Matcher(const ::string& s) { *this = Eq(s); } +#endif // GTEST_HAS_GLOBAL_STRING + +// Constructs a matcher that matches a absl::string_view whose value is equal to +// s. +Matcher<absl::string_view>::Matcher(const char* s) { + *this = Eq(std::string(s)); +} + +// Constructs a matcher that matches a absl::string_view whose value is equal to +// s. +Matcher<absl::string_view>::Matcher(absl::string_view s) { + *this = Eq(std::string(s)); +} +#endif // GTEST_HAS_ABSL namespace internal { @@ -113,12 +160,11 @@ namespace internal { // 'negation' is false; otherwise returns the description of the // negation of the matcher. 'param_values' contains a list of strings // that are the print-out of the matcher's parameters. -GTEST_API_ string FormatMatcherDescription(bool negation, - const char* matcher_name, - const Strings& param_values) { - string result = ConvertIdentifierNameToWords(matcher_name); - if (param_values.size() >= 1) - result += " " + JoinAsTuple(param_values); +GTEST_API_ std::string FormatMatcherDescription(bool negation, + const char* matcher_name, + const Strings& param_values) { + std::string result = ConvertIdentifierNameToWords(matcher_name); + if (param_values.size() >= 1) result += " " + JoinAsTuple(param_values); return negation ? "not (" + result + ")" : result; } |