Closed stla closed 10 months ago
Minimal reprex:
testthat::local_edition(3)
x <- -6.82378277453383e-02-8e-17i
y <- as.complex(-0.06823783)
testthat::expect_equal(x, y)
#> Error: `x` (`actual`) not equal to `y` (`expected`).
#>
#> Re(actual) != Re(expected) but don't know how to show the difference
waldo::compare(x, y)
#> `Re(old)`: -0.068237828
#> `Re(new)`: -0.068237830
#>
#> `Im(old)`: -0.00000000000000008
#> `Im(new)`: 0.00000000000000000
Created on 2023-11-28 with reprex v2.0.2.9000
The waldo output looks fine so this does indeed appear to be a testthat problem.
Oops, no, it is a waldo problem with the default testthat tolerance:
x <- -6.82378277453383e-02-8e-17i
y <- as.complex(-0.06823783)
waldo::compare(x, y, tolerance = testthat::testthat_tolerance())
#> Re(old) != Re(new) but don't know how to show the difference
Created on 2023-11-29 with reprex v2.0.2.9000
Now tracked in https://github.com/r-lib/waldo/issues/187
Hello,
This works if we specifiy
tolerance
.Latest versions of 'testthat', R and RStudio, Windows 10.