From 2a02723b76eae879bafbcee5143d5104a13c3626 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 3 May 2022 12:17:52 -0700 Subject: [PATCH] Fix example of DescribeMatcher to properly support negation. PiperOrigin-RevId: 446259163 Change-Id: I3ad5f405f44fc233f5cf5a18a274a9104b5c4ab8 --- googlemock/include/gmock/gmock-matchers.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index c349c2038..628290114 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -5068,7 +5068,8 @@ inline bool ExplainMatchResult(M matcher, const T& value, // // MATCHER_P(XAndYThat, matcher, // "X that " + DescribeMatcher(matcher, negation) + -// " and Y that " + DescribeMatcher(matcher, negation)) { +// (negation ? " or" : " and") + " Y that " + +// DescribeMatcher(matcher, negation)) { // return ExplainMatchResult(matcher, arg.x(), result_listener) && // ExplainMatchResult(matcher, arg.y(), result_listener); // }