You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 9, 2019. It is now read-only.
We have Expect.within for comparing floats, but people don't necessarily know it's there. They may use Expect.equal on floats, not realizing that they should use Expect.within instead.
It occurs to me that we could have Expect.equal fail the test when given two floats, with an error message pointing the caller to Expect.within instead.
Here's how we could implement it:
Have Expect.equal start by calling toString on both arguments
If that worked, truncate both floats and compare them with ==. If the truncation changed either of them, they were non-integers and should have been compared with Expect.within.