tests/testthat/test-rm_latest_packages.R

test_that("expect error when n = 0 or n < 0", {
  expect_error(rm_latest_packages(n = 0))
  expect_error(rm_latest_packages(n = -1))
  expect_error(rm_latest_packages(n = -1))
  expect_error(rm_latest_packages(n = -100))

})


test_that("expect error when n not numeric or not length 1", {
  expect_error(rm_latest_packages(n = "hello world"))
  expect_error(rm_latest_packages(n = c(32, 2323)))
  expect_error(rm_latest_packages(n = mtcars))
})

Try the batata package in your browser

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

batata documentation built on March 8, 2021, 5:06 p.m.