mirror of
https://github.com/google/googletest.git
synced 2024-12-27 10:11:03 +08:00
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:
parent
3fa7f983c6
commit
a4e0be898b
@ -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…
x
Reference in New Issue
Block a user