tests/testthat/test-calc_next.R

test_that("error messages work", {
  expect_error(
    calc_next(
      y = 27,
      n = c(100, 100)
    )
  )
  
  expect_error(
    calc_next(
      y = 27,
      n = 100,
      interval = 1.5
    )
  )
})

test_that("one-sample works as expected", {
  set.seed(123)
  expect_error(
    calc_next(
      y = 27,
      n = 100,
      S = 100
      ),
    NA)
})

test_that("two-sample works as expected", {
  set.seed(123)
  expect_error(
    calc_next(
      y = c(14, 23),
      n = c(100, 100),
      S = 100
      ),
    NA)
})

Try the ppseq package in your browser

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

ppseq documentation built on April 18, 2023, 1:08 a.m.