tests/testthat/test-expected.SAD.R

context("expected.SAD")

test_that("expected.SAD: use", {
  J <- 10000
  testthat::expect_silent(
    SAD <- expected.SAD(theta = 200, m = 0.09, J)
  )
})

test_that("expected.SAD: abuse", {
  J <- 10000
  expect_error(
      SAD <- expected.SAD(theta = -20, m = 0.09, J),
      "theta can not be below one")

  expect_error(
    SAD <- expected.SAD(theta = 20, m = -0.09, J),
    "m can not be below zero")

  expect_error(
    SAD <- expected.SAD(theta = 20, m = 0.09, J = -10),
    "J can not be below zero")

  expect_error(
    SAD <- expected.SAD(theta = 20, m = 1.09, J),
    "m can not be above 1")
})

Try the GUILDS package in your browser

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

GUILDS documentation built on April 12, 2025, 1:33 a.m.