tests/testthat/test-getParam.R

test_that('getParam', {
  expect_warning(res <- getParam('a', 1))
  expect_equal(res, 1)

  params <<- list()
  expect_error(getParam('a', 1))

  params <<- list(a=2)
  expect_silent(res <- getParam('a', 1))
  expect_equal(res, 2)
})

Try the rmake package in your browser

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

rmake documentation built on May 1, 2019, 10:37 p.m.