Closed
Description
I'm updating rgl
, and have changed the internal layout of some objects. I have an all.equal()
method for these objects that knows to ignore the irrelevant changes, but testthat::expect_equal()
doesn't use that. That's a bit irritating, but I can work around it by adding a compare_proxy
method that canonicalizes objects. However, output is now slightly misleading. For example, if I have two objects with components in a different order, the report doesn't reflect that:
library(rgl)
x <- cube3d()
names(x)
#> [1] "vb" "material" "normals" "texcoords" "ib"
y <- x
y$vb2 <- y$vb
y$vb <- NULL
waldo::compare(x, y)
#> `names(old)`: "ib" "material" "vb"
#> `names(new)`: "ib" "material" "vb2"
#>
#> `old$vb` is a double vector (-1, -1, -1, 1, 1, ...)
#> `new$vb` is absent
#>
#> `old$vb2` is absent
#> `new$vb2` is a double vector (-1, -1, -1, 1, 1, ...)
Created on 2021-04-14 by the reprex package (v1.0.0)
Notice that the names of x
don't match names(old)
, because we're really looking at compare_proxy(x)
.
I think it would be sufficient to add something like:
Using proxies for comparison:
at the start.
Metadata
Metadata
Assignees
Labels
No labels