Commit d01e356e by Abseil Team Committed by Xiaoyi Zhang

Googletest export

Allow copying of the string in MatchAndExplain. Otherwise, conversions from std::string_view to std::string will fail as being explicit PiperOrigin-RevId: 290301103
parent 9417fb40
...@@ -678,7 +678,7 @@ class StrEqualityMatcher { ...@@ -678,7 +678,7 @@ class StrEqualityMatcher {
template <typename MatcheeStringType> template <typename MatcheeStringType>
bool MatchAndExplain(const MatcheeStringType& s, bool MatchAndExplain(const MatcheeStringType& s,
MatchResultListener* /* listener */) const { MatchResultListener* /* listener */) const {
const StringType& s2(s); const StringType s2(s);
const bool eq = case_sensitive_ ? s2 == string_ : const bool eq = case_sensitive_ ? s2 == string_ :
CaseInsensitiveStringEquals(s2, string_); CaseInsensitiveStringEquals(s2, string_);
return expect_eq_ == eq; return expect_eq_ == eq;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment