waldo icon indicating copy to clipboard operation
waldo copied to clipboard

`compare(x, y, ..., list_as_map = TRUE)` fails to compare attributes

Open averissimo opened this issue 1 year ago • 1 comments

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"

averissimo avatar Nov 20 '23 10:11 averissimo

Created #186 PR as a fix for this if this proves to be a bug :sweat_smile:

averissimo avatar Nov 20 '23 10:11 averissimo