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
In testthat 3.1.10 and waldo 0.5.1, the helpfile for expect_equivalent() says that this function is deprecated and suggests you to use expect_equal(ignore_attr = TRUE) instead. Unfortunately, these two are apparently not equivalent.
a <- 1
names(a) <- "a"
expect_equivalent(a, unname(a)) # passes
expect_equal(a, unname(a), ignore_attr = TRUE) # fails
In addition, in the helpfile for waldo::compare() under ignore_attr, it says "For backward compatibility with all.equal(), you can also use TRUE, to all ignore differences in all attributes. This is not generally recommended as it is a blunt tool that will ignore many important functional differences."
The expect_equivalent() function was useful and the suggested alternative does not work in the use-case I am interested in.
The text was updated successfully, but these errors were encountered:
library(testthat)
a<-1
names(a) <-"a"
expect_equivalent(a, unname(a))
expect_equal(a, unname(a), ignore_attr=TRUE)
#> Error: `a` not equal to unname(a).#> names for target but not for current
In testthat 3.1.10 and waldo 0.5.1, the helpfile for
expect_equivalent()
says that this function is deprecated and suggests you to useexpect_equal(ignore_attr = TRUE)
instead. Unfortunately, these two are apparently not equivalent.In addition, in the helpfile for
waldo::compare()
underignore_attr
, it says "For backward compatibility with all.equal(), you can also use TRUE, to all ignore differences in all attributes. This is not generally recommended as it is a blunt tool that will ignore many important functional differences."The
expect_equivalent()
function was useful and the suggested alternative does not work in the use-case I am interested in.The text was updated successfully, but these errors were encountered: