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(415, 416, 0.01) # 0.01 silently not passed on to all.equal, apparently
Error: 415 not equal to 416
416 - 415 == 1
> expect_equal(415, 416, tolerance=0.01) # tolerance= now required.
We all know we should always name our arguments. Anyone who hasn't may now be bitten by this when they upgrade. It's the silent apparent ignoring of the 3rd argument that's confusing. ?expect_equals contains ... = other values passed to all.equal and when you then look at ?all.equal it seems reasonable to assume the 3rd argument matches up with the 3rd argument of all.equal (i.e. tolerance).
A few solutions I can think of are i) restoring previous behaviour, ii) catch and warn/error about any unnamed arguments or iii) add to ?expect_equals that tolerance must now be explicitly named.
The text was updated successfully, but these errors were encountered:
Hmmmm, I think the fix is to change the order of the compare.numeric arguments. Is currently (x, y, max_diffs = 10, ...), but I think it needs to be (x, y, ..., max_diffs = 10)
v0.9.1 : expected behaviour
v0.10.0 May 2015, currently on CRAN
We all know we should always name our arguments. Anyone who hasn't may now be bitten by this when they upgrade. It's the silent apparent ignoring of the 3rd argument that's confusing.
?expect_equals
contains... = other values passed to all.equal
and when you then look at?all.equal
it seems reasonable to assume the 3rd argument matches up with the 3rd argument ofall.equal
(i.e.tolerance
).A few solutions I can think of are i) restoring previous behaviour, ii) catch and warn/error about any unnamed arguments or iii) add to
?expect_equals
thattolerance
must now be explicitly named.The text was updated successfully, but these errors were encountered: