diff options
author | Abseil Team <absl-team@google.com> | 2020-10-14 20:55:07 (GMT) |
---|---|---|
committer | Derek Mauro <dmauro@google.com> | 2020-10-14 22:27:07 (GMT) |
commit | a4621888650aaae118de93f9faf8ef5a18cab303 (patch) | |
tree | cdef9c7c10bd81a75ad8e0b2dd9cf878ba85f20a /googlemock/docs | |
parent | f3dbe3ec44e0163c4659ec7cd541ca7af66632bc (diff) | |
download | googletest-a4621888650aaae118de93f9faf8ef5a18cab303.zip googletest-a4621888650aaae118de93f9faf8ef5a18cab303.tar.gz googletest-a4621888650aaae118de93f9faf8ef5a18cab303.tar.bz2 |
Googletest export
Add ::testing::FieldsAre matcher for objects that support get<> and structured bindings.
PiperOrigin-RevId: 337165285
Diffstat (limited to 'googlemock/docs')
-rw-r--r-- | googlemock/docs/cheat_sheet.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/googlemock/docs/cheat_sheet.md b/googlemock/docs/cheat_sheet.md index 78871bf..e6cffd0 100644 --- a/googlemock/docs/cheat_sheet.md +++ b/googlemock/docs/cheat_sheet.md @@ -403,6 +403,7 @@ messages, you can use: | `Field(&class::field, m)` | `argument.field` (or `argument->field` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_. | | `Key(e)` | `argument.first` matches `e`, which can be either a value or a matcher. E.g. `Contains(Key(Le(5)))` can verify that a `map` contains a key `<= 5`. | | `Pair(m1, m2)` | `argument` is an `std::pair` whose `first` field matches `m1` and `second` field matches `m2`. | +| `FieldsAre(m...)` | `argument` is a compatible object where each field matches piecewise with `m...`. A compatible object is any that supports the `std::tuple_size<Obj>`+`get<I>(obj)` protocol. In C++17 and up this also supports types compatible with structured bindings, like aggregates. | | `Property(&class::property, m)` | `argument.property()` (or `argument->property()` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_. | <!-- mdformat on --> |