From a4e0be898bc81cdbf96731336cb41ff03a6b1cc5 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 19 Dec 2022 08:27:30 -0800 Subject: [PATCH] Specify a name for a `Property` in a code example. It is good practice to specify a name for the `testing::Property` matcher's use in diagnostics, and we should do so in our examples. PiperOrigin-RevId: 496406309 Change-Id: Ibb4d1ba63771b5d6855442b91564027cda8ddaca --- docs/gmock_cook_book.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gmock_cook_book.md b/docs/gmock_cook_book.md index 6a795ec0..7672457c 100644 --- a/docs/gmock_cook_book.md +++ b/docs/gmock_cook_book.md @@ -904,7 +904,7 @@ using ::testing::Contains; using ::testing::Property; inline constexpr auto HasFoo = [](const auto& f) { - return Property(&MyClass::foo, Contains(f)); + return Property("foo", &MyClass::foo, Contains(f)); }; ... EXPECT_THAT(x, HasFoo("blah"));