test_that("as.xhaz puts 'xhaz' first and preserves other classes", { x <- structure(list(), class = c("mexhaz", "xhaz", "mexhazLT", "foo")) y <- as.xhaz(x) expect_class_first(y, "xhaz") # Order of the remaining classes preserved after 'xhaz' is moved first expect_identical(class(y)[-1], c("mexhaz", "mexhazLT", "foo")) })