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
This commit is contained in:
Abseil Team 2022-12-19 08:27:30 -08:00 committed by Copybara-Service
parent 3fa7f983c6
commit a4e0be898b

View File

@ -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"));