tests/testthat/test-run-studies-workflows.R

test_that("run.studies handles included and user-supplied tests", {
  set.seed(111)

  included <- run.studies(
    study = 1,
    B = 5,
    maxProcessor = 1,
    SuppressMessages = TRUE,
    ShowResult = FALSE
  )
  expect_probability_output(included)
  expect_gt(length(included), 0L)

  extra_pvalue <- list(
    Continuous = TRUE,
    WithEstimation = FALSE,
    Withpvalue = TRUE
  )
  supplied_pvalue <- run.studies(
    study = 1,
    TS = newTS,
    TSextra = extra_pvalue,
    param_alt = 0.3,
    With.p.value = TRUE,
    B = 5,
    maxProcessor = 1,
    SuppressMessages = TRUE,
    ShowResult = FALSE
  )
  expect_probability_output(supplied_pvalue)
  expect_gt(length(supplied_pvalue), 0L)

  extra_statistic <- list(
    Continuous = TRUE,
    WithEstimation = FALSE,
    Withpvalue = FALSE
  )
  supplied_statistic <- run.studies(
    study = 1,
    TS = newTS,
    TSextra = extra_statistic,
    param_alt = 0.3,
    B = 5,
    maxProcessor = 1,
    SuppressMessages = TRUE,
    ShowResult = FALSE
  )
  expect_probability_output(supplied_statistic)
  expect_gt(length(supplied_statistic), 0L)
})

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.