test_that("the right number of characters is created (n<=26)", {
l <- sample(1:26, size=1)
x <- create_anon_chars(l)
expect_identical(length(unique(x)), l)
expect_identical(any(is.na(x)), FALSE)
expect_true(is.character(x))
})
test_that("the right number of characters is created (n>26)", {
l <- 50
x <- create_anon_chars(l)
expect_equal(length(unique(x)), l)
expect_identical(any(is.na(x)), FALSE)
expect_true(is.character(x))
})
test_that("the right number of characters is created (n>676)", {
l <- 700
x <- create_anon_chars(l)
expect_equal(length(unique(x)), l)
expect_identical(any(is.na(x)), FALSE)
expect_true(is.character(x))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.