tests/testthat/test-options.R

test_that("error for unknown options", {
  expect_snapshot(error = TRUE, {
    r_process_options(
      func = function() {
      },
      foo = "bar"
    )
  })

  expect_snapshot(error = TRUE, {
    r_process_options(
      func = function() {
      },
      foo = "bar",
      bar = "foo"
    )
  })

  gc()
})
r-lib/callr documentation built on June 11, 2025, 2:48 p.m.