tests/testthat/test-utils.R

test_that("enum() works", {
    v     <- c(1L ,2L , 3L)
    venum <- enum(v)
    vattr <- attributes(venum)

    expect_identical(venum, v, ignore_attr = TRUE)
    expect_identical(vattr$cli_style$vec_sep,  ", ")
    expect_identical(vattr$cli_style$vec_last, " or ")
})

cli::test_that_cli("enum() can be rendered with a ui function", {
    expect_snapshot(ui_todo("{enum(c(1L, 2L, 3L))}"))
})
jeanmathieupotvin/dotprofile documentation built on Dec. 20, 2021, 10:08 p.m.