Skip to content

expect_equal cannot replicate expect_equivalent's behavior #1241

Closed
@egonulates

Description

@egonulates

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions