# ---------------------------------------------------------------------------- #
test_that("get_incremental_names works for default sep", {
vec_names <- c("item_1", "item_2", "item_3")
expect_equal(get_incremental_names(3, "item"), vec_names)
})
# ---------------------------------------------------------------------------- #
test_that("get_incremental_names works for blank sep", {
expect_equal(get_incremental_names(2, "item", sep = ""), c("item1", "item2"))
})
# ---------------------------------------------------------------------------- #
test_that("get_incremental_names works for more than 9 items", {
ex <- c(
"x_01", "x_02", "x_03", "x_04", "x_05", "x_06", "x_07", "x_08", "x_09",
"x_10", "x_11"
)
expect_equal(get_incremental_names(11, "x"), ex)
})
# ---------------------------------------------------------------------------- #
test_that("get_incremental_names works for non-default start val", {
expect_equal(get_incremental_names(3, "a", start = 0), c("a_0", "a_1", "a_2"))
})
# ---------------------------------------------------------------------------- #
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.