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
Perhaps this issue is known or has been reported before - in that case, apologies.
all.equal uses its first argument to compute the denominator of the relative difference. waldo::compare uses its second argument, leading to differences in behaviour as here:
help("compare", package="waldo") and help("expect_equal", package="testthat") don't claim that they are drop-in replacements for all.equal(...) and stopifnot(all.equal(...)), but that seems to be a prevailing belief. The situation would be improved with clearer documentation about the correspondence of the arguments.
The text was updated successfully, but these errors were encountered:
A corollary is that testthat::expect_equal(x, y, tolerance = tol) can fail under edition 2 and pass under edition 3. In that case, with the arguments reversed, the test would pass under edition 2 and fail under edition 3.
Hmm I thought of this as a difference in signatures since testthat::expect_equal() does object,expected whereas all.equal() does target,current which (to me) maps to actual,expected vs. expected,actual.
But if we look carefully at waldo::compare()'s signature directly, it gives the same impression as all.equal():
waldo::comparefunction (x, y, ..., x_arg="old", y_arg="new"...)
old ~~ expected new ~~ actual
The terminology is admittedly all over the place as we can see :)
Perhaps this issue is known or has been reported before - in that case, apologies.
all.equal
uses its first argument to compute the denominator of the relative difference.waldo::compare
uses its second argument, leading to differences in behaviour as here:help("compare", package="waldo")
andhelp("expect_equal", package="testthat")
don't claim that they are drop-in replacements forall.equal(...)
andstopifnot(all.equal(...))
, but that seems to be a prevailing belief. The situation would be improved with clearer documentation about the correspondence of the arguments.The text was updated successfully, but these errors were encountered: