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

isNotEqualTo(boolean) fails if actual is null #3341

Closed
biergit opened this issue Jan 19, 2024 · 2 comments
Closed

isNotEqualTo(boolean) fails if actual is null #3341

biergit opened this issue Jan 19, 2024 · 2 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@biergit
Copy link
Contributor

biergit commented Jan 19, 2024

assertThat(Boolean.TRUE).isEqualTo(true) -> success
assertThat((Boolean)null).isNotEqualTo(Boolean.TRUE) -> success
assertThat((Boolean)null).isNotEqualTo(true) -> Expecting actual not to be null.

@scordio
Copy link
Member

scordio commented Jan 19, 2024

It seems so 😉

assertThat(Boolean.TRUE.equals(true)).isTrue(); // succeeds

But now I understand what you mean... good catch!

isNotEqualTo(boolean) shouldn't enforce a non-null actual, considering also that isNotEqualTo(Object) allows it.

Would you like to submit a PR for a fix?

@scordio scordio changed the title Is Boolean.TRUE really equal to true ? isNotEqualTo(boolean) fails if actual is null Jan 19, 2024
@scordio scordio added the type: bug A general bug label Jan 19, 2024
@biergit
Copy link
Contributor Author

biergit commented Jan 22, 2024

Hi @scordio, sure I'll take a look :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants