- 
        Couldn't load subscription status. 
- Fork 1.4k
zio-test: improvements for assert capturing expression and location #4533
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
zio-test: improvements for assert capturing expression and location #4533
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
| @dkarlinsky nice! Just noticed this when rebasing my changes. Did you make this adjustment for the dotty variant as well? | 
| 
 Yes, and in dotty you can just get the actual source: Term.of(expr).pos.sourceCode | 
| Ah cool! I saw that specific line was rewritten by @sideeffffect (https://github.com/zio/zio/blob/master/test/shared/src/main/scala-dotty/zio/test/CompileVariants.scala#L105), but I guess it's for compat with the latest dotty. Thanks! | 
| Exactly, Scala 3.0.0-M3's method  | 
This is a refinement of #4427

Moves the captured expression into the description of the value being asserted on.
Moves the source location to a separate line.
Also made rendered expressions much cleaner - closer to how you would normally write the code.
Under dotty the actual source code is shown.
Example (for Scala 2.x)