Closed christophsturm closed 5 months ago
also related to #74
here's documentation for some of the smart things scalatest does with assert: https://www.scalatest.org/user_guide/using_assertions
Yes, I do think this is related to #45. One of the benefits we would get from that ticket is the ability to have much more complex diagram logic. Being able to include diffs for equalities of strings and collections, being able to compress the diagram slightly when display strings don't overlap or just have a much more rich diagram, custom behavior specific to individual assertion libraries, etc. There's a lot of benefits and this is something I'd like to tackle next for this library.
For now, I'll leave this ticket up so I remember to add this specific use case, but I suspect it will get implemented alongside #45.
Ticket has been moved to Kotlin YouTrack: https://youtrack.jetbrains.com/issue/KT-66806
scalatest and zio test power assert both have this nice feature:
when you write assert("xxx" == "yyy") this is recognized as a comparision and it shows a diff when it fails.
I'm not sure whats the best way to implement that, but maybe it should be implemented not in the compiler plugin but in a support lib, the compiler plugin would just supply the metadata (ast?) to make it possible to find and special case the equals method. (related to #45)