You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modify the summary diff of EqMatcher::explain_match in the case that the debug output resembles that of a string.
Previously, multiline strings would not benefit from the diff output feature of `EqMatcher::explain_match` because they would only ever be a single line.
This uses a heuristic to detect whether the expected and actual debug outputs are likely those of multiline strings. This is the case when they are surrounded by quotes, do not contain newlines, and do contain escaped newlines. In that case, `EqMatcher::explain_match` will simulate the `Display` output of the strings and output a diff of those instead of the debug output. Such uses of `eq` will now benefit from this feature.
This does not change `eq_deref_of` analogously, since it doesn't make any sense to use `eq_deref_of` on string types.
PiperOrigin-RevId: 533481089
0 commit comments