swift-testing icon indicating copy to clipboard operation
swift-testing copied to clipboard

Diffing for equality (e.g. ==) expressions in expectations

Open stmontgomery opened this issue 7 months ago • 2 comments

Description

This tracks enhancing expectations (e.g. #expect and similar) so that when the top-level expression is a binary equality operator (e.g. a == b) and the expectation fails, the failure message should attempt to collect and show a meaningful "diff", i.e. a summary of the differences of the two operands and their substructure.

Additional information

There's a lot of prior art in this space in other testing frameworks/libraries. For example, Difference.

stmontgomery avatar Aug 18 '25 02:08 stmontgomery

I could swear we have an issue tracking this feature already.

grynspan avatar Aug 18 '25 03:08 grynspan

Maybe #11?

turbolent avatar Oct 26 '25 04:10 turbolent