tests/testthat/test-valid_id.R

testthat::test_that("char string of nchar 36 returns TRUE", {
  testthat::expect_true(
    valid_id(paste0(rep("a", 36), collapse = ""))
  )
})

testthat::test_that("char string of nchar < 36 returns FALSE", {
  testthat::expect_false(
    valid_id(paste0(rep("a", 35), collapse = ""))
  )
})

testthat::test_that("char string of nchar > 36 returns FALSE", {
  testthat::expect_false(
    valid_id(paste0(rep("a", 37), collapse = ""))
  )
})

Try the odns package in your browser

Any scripts or data that you put into this service are public.

odns documentation built on Nov. 10, 2022, 5:56 p.m.