tests/testthat/test-continuous-workflows.R

test_that("continuous goodness-of-fit workflows run", {
  set.seed(113)
  range01 <- matrix(c(0, 1, 0, 1), 2, 2)

  simple <- gof_test(
    rnull_u2(), pnull_u2, rnull_u2,
    Ranges = range01, dnull = dnull_u2,
    doMethods = "qK", B = 10, maxProcessor = 1
  )
  expect_gof_contract(simple)

  custom <- gof_test(
    ralt_u2(1.5), pnull_u2, rnull_u2,
    Ranges = range01, dnull = dnull_u2,
    TS = TS_cont, B = 10, maxProcessor = 1
  )
  expect_gof_contract(custom)

  estimated <- gof_test(
    ralt_ne(0), pnull_ne, rnull_ne,
    phat = phat_mean, dnull = dnull_ne,
    doMethods = "qK", B = 10, maxProcessor = 1
  )
  expect_gof_contract(estimated)

  power_simple <- gof_power(
    pnull_u2, rnull_u2, ralt_u2, c(1, 1.4),
    Ranges = range01, dnull = dnull_u2,
    B = 10, maxProcessor = 1,
    SuppressMessages = TRUE
  )
  expect_probability_output(power_simple)

  power_estimated <- gof_power(
    pnull_ne, rnull_ne, ralt_ne, c(0, 0.5),
    dnull = dnull_ne, phat = phat_mean,
    B = 10, maxProcessor = 1,
    SuppressMessages = TRUE
  )
  expect_probability_output(power_estimated)
})

Try the MDgof package in your browser

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

MDgof documentation built on Sept. 23, 2026, 5:08 p.m.