waldo
waldo copied to clipboard
`compare(x, y, ..., list_as_map = TRUE)` fails to compare attributes
Is this the expected behavior?
x <- structure(list(a = 2, b = 1), attr1 = "a")
y <- structure(list(a = 2, b = 1))
waldo::compare(x, y)
#> `attr(old, 'attr1')` is a character vector ('a')
#> `attr(new, 'attr1')` is absent
waldo::compare(x, y, list_as_map = TRUE)
#> ✔ No differences
attributes(x)
#> $names
#> [1] "a" "b"
#>
#> $attr1
#> [1] "a"
attributes(waldo:::as_map(x))
#> $names
#> [1] "a" "b"
Created #186 PR as a fix for this if this proves to be a bug :sweat_smile: