tests/testthat/test_deparse.R

context("deparse")

test_that("deparse", {
  f = function(num, na.ok) {
    assertNumber(num)
    qassert(na.ok, "B1")
  }

  expect_true(f(1, TRUE))
  expect_error(f(NULL, TRUE), "num")
  expect_error(f(1, NULL), "na.ok")
})

Try the checkmate package in your browser

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

checkmate documentation built on July 4, 2019, 5:12 p.m.