tests/testthat/test-options.R

test_that("error for unknown options", {

  expect_error(
    r_process_options(func = function() {}, foo = "bar"),
    "Unknown option"
  )

  expect_error(
    r_process_options(func = function() {}, foo = "bar", bar = "foo"),
    "Unknown options"
  )

  gc()
})

Try the callr package in your browser

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

callr documentation built on Nov. 2, 2022, 5:09 p.m.