tests/testthat/test-scompvar.R

data("simResults")

test_that("function works", {
  testthat::expect_no_condition(scompvar(simResults))
  testthat::expect_error(scompvar(simResults, n = 1), "larger")
  testthat::expect_error(scompvar(simResults, m = 8), "larger")
})

test_that("results are reproducible", {
  testthat::expect_equal(round(scompvar(simResults, n = 4, m = 4)[,2],6),
               c(0.069845, 0.330363))
})

test_that("no error in documentation", {
  expect_silent(help("scompvar"))
})

Try the ecocbo package in your browser

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

ecocbo documentation built on Sept. 11, 2024, 8:09 p.m.