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

assertNotEquals produces unhelpful message on assertion fail. #712

Closed
zaclegarssure opened this issue Oct 19, 2023 · 1 comment
Closed

Comments

@zaclegarssure
Copy link

Hi,

When using assertNotEquals if the assertion fails, by default, the error message is quite unhelpful.
For instance with the following test (tested on munit version 1.0.0-M10):

test("example test that fails") {
  val obtained = 42
  val expected = 42
  assertNotEquals(obtained, expected)
}

we obtain: values are the same expected same: 42 was not: 42.

The expected same is a bit contradictory, same for the was not. Maybe something like "values are the same, expected two different values: 42 is equal to 42" would be enough. It's a quick fix in Assertions.scala, I can open a PR if needed.

@valencik
Copy link
Collaborator

Oh yeah, that does not seem super easy to understand.
A PR improving clarity would be great!

ekans pushed a commit to ekans/munit that referenced this issue Dec 17, 2023
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