expect_list <- checkmate::expect_list
expect_identical <- testthat::expect_identical
test_cars <-
datasets::mtcars %>%
rownames_to_column("name") %>%
transmute(name, mpg, cyl) %>%
tibble()
test_construct <- function(data, defn, class = defn, envir = parent.frame()) {
constructed <- construct(data, defn, envir = envir)
expect_list(constructed, class)
deconstructed <- deconstruct(constructed, defn, envir = envir)
expect_identical(deconstructed, data)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.