Fix EXPECT_THAT() to support literal strings as a second argument.
This commit is contained in:
@@ -1833,7 +1833,7 @@ class MatcherAsPredicate {
|
||||
template <typename M>
|
||||
class PredicateFormatterFromMatcher {
|
||||
public:
|
||||
explicit PredicateFormatterFromMatcher(const M& m) : matcher_(m) {}
|
||||
explicit PredicateFormatterFromMatcher(M m) : matcher_(internal::move(m)) {}
|
||||
|
||||
// This template () operator allows a PredicateFormatterFromMatcher
|
||||
// object to act as a predicate-formatter suitable for using with
|
||||
@@ -1873,10 +1873,11 @@ class PredicateFormatterFromMatcher {
|
||||
// A helper function for converting a matcher to a predicate-formatter
|
||||
// without the user needing to explicitly write the type. This is
|
||||
// used for implementing ASSERT_THAT() and EXPECT_THAT().
|
||||
// Implementation detail: 'matcher' is received by-value to force decaying.
|
||||
template <typename M>
|
||||
inline PredicateFormatterFromMatcher<M>
|
||||
MakePredicateFormatterFromMatcher(const M& matcher) {
|
||||
return PredicateFormatterFromMatcher<M>(matcher);
|
||||
MakePredicateFormatterFromMatcher(M matcher) {
|
||||
return PredicateFormatterFromMatcher<M>(internal::move(matcher));
|
||||
}
|
||||
|
||||
// Implements the polymorphic floating point equality matcher, which matches
|
||||
|
||||
Reference in New Issue
Block a user