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
pull/4100/head
Abseil Team 2 years ago committed by Copybara-Service
parent 3fa7f983c6
commit a4e0be898b
  1. 2
      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"));

Loading…
Cancel
Save