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 #111

Open
zainab-ali opened this issue Nov 7, 2024 · 6 comments
Open

Invalid printing of multi-line assertions #111

zainab-ali opened this issue Nov 7, 2024 · 6 comments

Comments

@zainab-ali
Copy link
Contributor

This issue was copied over from: disneystreaming/weaver-test#186
It was opened by: kubukoz


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.

@zainab-ali
Copy link
Contributor Author

This comment was copied over from: disneystreaming/weaver-test#186 (comment)
It was written by: kubukoz


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

@zainab-ali
Copy link
Contributor Author

This comment was copied over from: disneystreaming/weaver-test#186 (comment)
It was written by: Baccata


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 ?

@zainab-ali
Copy link
Contributor Author

This comment was copied over from: disneystreaming/weaver-test#186 (comment)
It was written by: kubukoz


Missed this...

weaver 0.5.1, scala 2.13.4

@zainab-ali
Copy link
Contributor Author

This comment was copied over from: disneystreaming/weaver-test#186 (comment)
It was written by: Baccata


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.

@zainab-ali
Copy link
Contributor Author

This comment was copied over from: disneystreaming/weaver-test#186 (comment)
It was written by: kubukoz


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...

@zainab-ali
Copy link
Contributor Author

This comment was copied over from: disneystreaming/weaver-test#186 (comment)
It was written by: Baccata


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

1 participant