tests/testthat/test-util-assert.R

context("assertions")

test_that("assert_is", {
  expect_error(assert_is(NULL, "function"),
               "must be a function")
  expect_silent(assert_is(sin, "function"))
})

test_that("assert_raw", {
  expect_error(assert_raw(1), "must be raw")
  expect_silent(assert_raw(raw(1)))
})

Try the cyphr package in your browser

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

cyphr documentation built on June 20, 2022, 5:17 p.m.