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

uncommon Int expectations handled unexpectedly #192

Open
lue-bird opened this issue Aug 18, 2022 · 1 comment
Open

uncommon Int expectations handled unexpectedly #192

lue-bird opened this issue Aug 18, 2022 · 1 comment

Comments

@lue-bird
Copy link

lue-bird commented Aug 18, 2022

elm-test thinks Ints are Floats with

  • Infinity
  • -Infinity
((1 / 0) |> round) |> Expect.equal ((1 / 0) |> round)

Do not use Expect.equal with floats. Use Float.within instead.

elm-test doesn't complain on

  • different versions of NaN (which are always correctly reported as "expectation hasn't been met")
  • fractions (created from n ^ -x) (this is kinda surprising)
@lue-bird
Copy link
Author

(This is a really niche issue which won't provide much use being addressed)

@lue-bird lue-bird changed the title uncommon Int/Float expectations handled unexpectedly uncommon Int expectations handled unexpectedly Aug 18, 2022
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