Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show diff for equals assertions. #76

Closed
christophsturm opened this issue Dec 2, 2022 · 4 comments
Closed

show diff for equals assertions. #76

christophsturm opened this issue Dec 2, 2022 · 4 comments

Comments

@christophsturm
Copy link
Contributor

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)

@christophsturm
Copy link
Contributor Author

also related to #74

@christophsturm
Copy link
Contributor Author

here's documentation for some of the smart things scalatest does with assert: https://www.scalatest.org/user_guide/using_assertions

@bnorm
Copy link
Owner

bnorm commented Mar 1, 2023

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.

@bnorm
Copy link
Owner

bnorm commented Jun 9, 2024

Ticket has been moved to Kotlin YouTrack: https://youtrack.jetbrains.com/issue/KT-66806

@bnorm bnorm closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants