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
expect_equal does relative comparisons for values greater than one in magnitude, but does decimal place comparisons for values less than one in magnitude. Is there any way short of writing a custom helper function to do relative comparisons for all nonzero expectations?
For instance, if you are developing a probability calculation, then 1e-11 should be an epic fail for an expectation of 1e-300, but expect_equal considers it a pass. I have tried tolerance with both editions, but do not obtained the desired behavior.
The text was updated successfully, but these errors were encountered:
If you don't get the behaviour that you want with the built-in tools, yes, you'll need to write it yourself.
It would be nice to do better in (e.g.) waldo::compare() but at this point making any changes to the algorithm is expensive because it may cause tests to break in CRAN packages, and those tests will need to be fixed prior to submission.
expect_equal does relative comparisons for values greater than one in magnitude, but does decimal place comparisons for values less than one in magnitude. Is there any way short of writing a custom helper function to do relative comparisons for all nonzero expectations?
For instance, if you are developing a probability calculation, then 1e-11 should be an epic fail for an expectation of 1e-300, but expect_equal considers it a pass. I have tried tolerance with both editions, but do not obtained the desired behavior.
The text was updated successfully, but these errors were encountered: