obj1 <- structure(numeric(), class = "hello")

`obj2` should be class "hello" (is "numeric")

[1] "`obj2` should be class \"hello\" (is \"numeric\")"

obj2 <- structure(numeric(), class = c(letters[10:12], letters[1:3], 
    letters[8:9]))

obj1 <- structure(numeric(), class = letters[1:3])

obj2 <- structure(numeric(), class = c("b", "a", "c"))

obj2 <- structure(numeric(), class = c("a", "b", "x", "c"))

obj2 <- structure(numeric(), class = c("a", "b", "c"))

obj2 <- structure(numeric(), class = c("x", "a", "b", "c"))

alike(obj1, obj2, settings = vetr_settings(attr.mode = 1))

`length(class(obj2))` should be 3 (is 4)

[1] "`length(class(obj2))` should be 3 (is 4)"

# By virtue of vetr being the first package on the search path, that is where
# the class definitions will go due to logic in topenv().  This might not be
# robust in the long term as "this works" only because topenv() assumes it's
# being evaluated in the namespace due to not running into global env first.
#
# Ultimately, we might need to scrub the error messages of the environment
# name to make this truly reproducible.

w <- structure(list(a = character(), b = numeric()), class = "vetr_foo")

`z` should inherit from S4 class "vetr_foo" from pkg:vetr (is "vetr_bar" from pkg:vetr)

[1] "`z` should inherit from S4 class \"vetr_foo\" from pkg:vetr (is \"vetr_bar\" from pkg:vetr)"

`x` should inherit from S4 class "vetr_baz" from pkg:vetr (is "vetr_foo" from pkg:vetr)

[1] "`x` should inherit from S4 class \"vetr_baz\" from pkg:vetr (is \"vetr_foo\" from pkg:vetr)"

# FALSE, child class is target, so parent can't match

`lst.5[[2]][[2]][[1]]` should inherit from S4 class "vetr_baz" from pkg:vetr (is "vetr_foo" from pkg:vetr)

[1] "`lst.5[[2]][[2]][[1]]` should inherit from S4 class \"vetr_baz\" from pkg:vetr (is \"vetr_foo\" from pkg:vetr)"

Setting class(x) to multiple strings ("vetr_baz", "vetr_foo", ...); result will no longer be an S4 object

Warning in class(v2) <- c("vetr_baz", "vetr_foo") :
  Setting class(x) to multiple strings ("vetr_baz", "vetr_foo", ...); result will no longer be an S4 object