From ae8d1fc81b1469905b3d0fa6f8a077f58fc4b250 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 2 Dec 2019 15:30:24 -0500 Subject: Googletest export Clarify use of IsTrue and IsFalse matchers. These matchers are subtle and confusing: what are they for? The docs in the code are clear, but not very accessible. googletest/googlemock/include/gmock/gmock-more-matchers.h PiperOrigin-RevId: 283393275 --- googlemock/docs/cheat_sheet.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/googlemock/docs/cheat_sheet.md b/googlemock/docs/cheat_sheet.md index f6e7349..b425e0a 100644 --- a/googlemock/docs/cheat_sheet.md +++ b/googlemock/docs/cheat_sheet.md @@ -278,6 +278,12 @@ copy constructor, try wrap it in `ByRef()`, e.g. `Eq(ByRef(non_copyable_value))`. If you do that, make sure `non_copyable_value` is not changed afterwards, or the meaning of your matcher will be changed. +`IsTrue` and `IsFalse` are useful when you need to use a matcher, or for types +that can be explicitly converted to Boolean, but are not implicitly converted to +Boolean. In other cases, you can use the basic +[`EXPECT_TRUE` and `EXPECT_FALSE`](../../googletest/docs/primer#basic-assertions) +assertions. + #### Floating-Point Matchers {#FpMatchers} -- cgit v0.12