tests/testthat/test-nchar.R

test_that("nchar", {
  rlang::scoped_options(lifecycle_verbosity = "quiet")
  expect_identical(check_nchar(1), 1)
  expect_identical(check_nchar(1, 1), 1)
  expect_error(check_nchar(1, 2), "1 must have 2 characters")
  expect_error(check_nchar(1, FALSE), "1 must have 0 characters")
  y <- c("o", "22")
  expect_error(check_nchar(y, c(1,1)), "y must not have more than 1 character")
})
poissonconsulting/checkr documentation built on Oct. 18, 2023, 9:39 p.m.