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
Since expect_equivalent function deprecated, I tried to use expect_equal(ignore_attr = TRUE) without any success:
library(testthat)
x <- 1
(y <- setNames(1, 'a'))
#> a
#> 1
# Old function working perfectly
expect_equivalent(x, y)
# New function does not work
expect_equal(x, y, ignore_attr = TRUE)
#> Error: `x` not equal to `y`.
#> names for current but not for target
Activity
hadley commentedon Nov 19, 2020
expect_equal()no longer ignores names because they're so important for describing details. I'd recommend using an explicitunname()instead.