test_that("list", {
rlang::scoped_options(lifecycle_verbosity = "quiet")
x <- list(x = 1, 2)
expect_identical(check_list(x), x)
expect_identical(check_list(x, values = "x"), x)
expect_identical(check_list(x, values = list(x = 1)), x)
x <- c(1, 2)
expect_error(check_list(x), "x must be a list")
})
test_that("check_list produces warnings", {
rlang::scoped_options(lifecycle_verbosity = "quiet")
x <- list(x = 1, 2)
lifecycle::expect_deprecated(check_list(x, named = TRUE))
lifecycle::expect_deprecated(check_list(x, unique = TRUE))
lifecycle::expect_deprecated(check_list(x, length = 2))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.