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

Invalid printing of multi-line assertions #186

Open
kubukoz opened this issue Jan 25, 2021 · 6 comments
Open

Invalid printing of multi-line assertions #186

kubukoz opened this issue Jan 25, 2021 · 6 comments

Comments

@kubukoz
Copy link
Member

kubukoz commented Jan 25, 2021

This might be an expecty bug, I didn't check yet.

For a test like this:

pureTest("demo") {
  assert(
    List(1, 2, 3).sum == List(
      1 + 2,
      3 + 1
    ).sum
  )
}

You will see:

[E] - demo
[E]   assertion failed (../../dev/pass/kernel/src/test/scala/com/ocado/ospnow/wms/tap/kernel/ConsumerOpsTests.scala:62)
[E]
[E]   List(1, 2, 3).sum == List(
[E]   | |           |   |  |
[E]   | 7           6   |  List(3, 4)
[E]   List(1, 2, 3)     false
[E]
[E]

You can see the 7 that was the result of the RHS, but it's not in the valid position.

@kubukoz
Copy link
Member Author

kubukoz commented Jan 25, 2021

This was in bloop, just checked and it's also the case in sbt :)

@Baccata
Copy link
Contributor

Baccata commented Jan 26, 2021

This one will have to be opened in https://github.com/eed3si9n/expecty (which we delegate power-assertions to). Fortunately, Anton and myself have stepped up as maintainers there.

Out of curiosity, what versions of weaver and scala are you using ?

@kubukoz
Copy link
Member Author

kubukoz commented Feb 12, 2021

Missed this...

weaver 0.5.1, scala 2.13.4

@Baccata
Copy link
Contributor

Baccata commented Feb 12, 2021

What would be the rendering you'd like to see ? Honestly I'm tempted to just make the macro fail on multi-line expressions as all possibilities I can think of will be confusing one way or the other.

Also don't hesitate to try out the latest , we're just waiting for CE3 for an official 0.6.0/0.7.0 release but I don't think we'll be breaking much between now and then.

@kubukoz
Copy link
Member Author

kubukoz commented Feb 13, 2021

The project I'm using this in isn't really anything for work and there's no immediate need to upgrade 😅 I was just waiting for scala steward to do the job for me...

@Baccata
Copy link
Contributor

Baccata commented Feb 13, 2021

Alright then 😄

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