context("list_helpers")
test_that("is_leaf detects leaves correctly", {
expect_error(is_leaf())
expect_true(is_leaf(FALSE))
expect_true(is_leaf(LETTERS))
expect_true(is_leaf(data.frame(LETTERS)))
expect_false(is_leaf(list(LETTERS)))
})
test_that("get_names works", {
expect_error(get_names())
expect_identical(get_names(NULL), character(0))
expect_identical(get_names(0), "")
expect_identical(get_names(list(x = 1, y = 2)), c("x", "y"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.