test_that("it works on atomic structures", {
x <- c(a = 1, b = 2, 3)
y <- c(a = 1, b = 2, c = 3)
z <- c(1, 2, 3)
expect_true(has_names(y))
expect_false(has_names(x))
expect_false(has_names(z))
})
test_that("it works on recursive structures", {
x <- list(a = 1, b = 2, 3)
y <- list(a = 1, b = 2, c = 3)
z <- list(1, 2, 3)
expect_true(has_names(y))
expect_false(has_names(x))
expect_false(has_names(z))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.