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 Oct. 25, 2023, 5:06 p.m.