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

New Number match for equivalence #298

Open
jet11x opened this issue Apr 20, 2020 · 1 comment
Open

New Number match for equivalence #298

jet11x opened this issue Apr 20, 2020 · 1 comment

Comments

@jet11x
Copy link

jet11x commented Apr 20, 2020

I've found code easier to read and more functional when moving from assertEquals to the Hamcrest matchers. However, I've found it a pain have to make sure the types of primatives are the same given the matchers require Objects.

I've written a small matcher I've called IsNumberEquiv with a static check called equivTo which passes if values are numerically the same.

I've written a reasonable initial set of tests and covered the standard implementations of Number. Happy to contribute this as appropriate e.g. patch or commit, if there's interest.

@tumbarumba
Copy link
Member

Can you show some sample code that demonstrates the problem?

I'd be curious to see your IsNumberEquiv. Feel free to raise a PR, if you're keen.

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