`Approximately(proto_matcher)` |
The same as `proto_matcher` except that it compares floating-point fields approximately. |
`Approximately(proto_matcher, margin)` |
The same as `Approximately(proto_matcher)` except that two floating-point fields are considered equal if their absolute difference is <= `margin`. |
`Approximately(proto_matcher, margin, fraction)` |
The same as `Approximately(proto_matcher)` except that two floating-point fields are considered equal if their absolute difference is <= `margin` or their fractional difference is <= `fraction`. |
`TreatingNaNsAsEqual(proto_matcher)` |
The same as `proto_matcher` except that two floating-point fields are considered equal if both are NaN, matching the behavior of `NanSensitiveDoubleEq()`. |
`IgnoringRepeatedFieldOrdering(proto_matcher)` |
The same as `proto_matcher` except that it ignores ordering of elements within repeated fields (see `proto2::MessageDifferencer::TreatAsSet()` for more details). |
`IgnoringFieldPaths({"some_field.subfield"}, proto_matcher)` |
The same as `proto_matcher` except that it ignores the value of field `subfield` in field `some_field`. |
`Partially(proto_matcher)` |
The same as `proto_matcher` except that only fields present in the expected protocol buffer are considered. |
`WhenDeserialized(typed_proto_matcher)` |
`argument` is a string in the protocol buffer binary format that can be deserialized to a protocol buffer matching `typed_proto_matcher`. |
`WhenDeserializedAs(matcher)` |
`argument` is a string in the protocol buffer binary format that can be deserialized to a protocol buffer of type `PB` that matches `matcher`. |
`WhenParsedFromProtoText(typed_proto_matcher)` |
`argument` is a string in the protocol buffer text format that can be parsed to a protocol buffer matching `typed_proto_matcher`. |
`WhenParsedFromProtoTextAs(matcher)` |
`argument` is a string in the protocol buffer text format that can be parsed to a protocol buffer of type `PB` that matches `matcher`. |
`WhenUnpacked(typed_proto_matcher)` |
`argument` is a `google.protobuf.Any` that can be unpacked into a protocol buffer of the type of `typed_proto_matcher` that matches that matcher. |
`WhenUnpackedTo(matcher)` |
`argument` is a `google.protobuf.Any` that can be unpacked into a protocol buffer of type `PB` that matches `matcher`. |
where:
* `proto_matcher` can be any of the `Equals*` and `EquivTo*` protocol buffer
matchers above,
* `typed_proto_matcher` can be an `Equals*` or `EquivTo*` protocol buffer
matcher where the type of the expected protocol buffer is known at run time
(e.g. `EqualsProto(expected_pb)` or `EqualsProto