# ---------------------------------------------------------------------------- #
test_that("set_init_seed works for integer seed value", {
expect_silent(set_init_seed(1))
})
# ---------------------------------------------------------------------------- #
test_that("set_init_seed accepts seed value of 'random'", {
expect_silent(set_init_seed("random"))
})
# ---------------------------------------------------------------------------- #
test_that("set_init_seed accepts 'NULL' seed value", {
expect_silent(set_init_seed(NULL))
})
# ---------------------------------------------------------------------------- #
test_that("set_init_seed accepts 'NA' seed value", {
expect_silent(set_init_seed(NA))
})
# ---------------------------------------------------------------------------- #
test_that("set_init_seed fails for non-integerish seed value", {
expect_jute_error(set_init_seed("5aab"))
})
# ---------------------------------------------------------------------------- #
test_that("set_init_seed fails with message for non-integerish seed value", {
expect_snapshot(set_init_seed("5aab"), error = TRUE)
})
# ---------------------------------------------------------------------------- #
test_that("set_init_seed fails for vector seed value", {
expect_jute_error(set_init_seed(c(1, 2)))
})
# ---------------------------------------------------------------------------- #
test_that("set_init_seed fails with message for vector seed value", {
expect_snapshot(set_init_seed(c(1, 2)), error = TRUE)
})
# ---------------------------------------------------------------------------- #
test_that("set_init_seed fails for vector of NA seed values", {
expect_jute_error(set_init_seed(c(NA, NA)))
})
# ---------------------------------------------------------------------------- #
test_that("set_init_seed fails with message for vector of NA seed values", {
expect_snapshot(set_init_seed(c(NA, NA)), error = TRUE)
})
# ---------------------------------------------------------------------------- #
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.