tests/testthat/test-utils.R

test_that("check_string() works", {
  expect_null(check_string("string"))
  expect_null(check_string(NULL, optional = TRUE))

  expect_snapshot(error = TRUE, {
    name <- 1
    check_string(name)
    check_string(name, nm = "NAME!")
  })
})

Try the readr package in your browser

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

readr documentation built on May 29, 2024, 2:37 a.m.