tests/testthat/test-check-string.R

context("check-string")

test_that("check_string errors", {
  y <- "oeu"
  expect_identical(check_string(y), y)
  y <- 2
  expect_error(check_string(y), "y must be of class 'character'")
  y <- c(TRUE, TRUE)
  expect_error(check_string(y), "y must be a scalar")
})

Try the datacheckr package in your browser

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

datacheckr documentation built on May 30, 2017, 6:05 a.m.