Skip to content

Commit

Permalink
Specify a name for a Property in a code example.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Abseil Team authored and copybara-github committed Dec 19, 2022
1 parent 3fa7f98 commit a4e0be8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/gmock_cook_book.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit a4e0be8

Please sign in to comment.