tests/testthat/test-simulate_minimalist_model.R

library(testthat)

context("Test the simulate method with minimalist examples")

seed <- 1
source(file.path(getwd(), test_path(), "test-utils.R"))

test_that("Simulate a minimalist model, no parameters/IIV/error model", {
  regFilename <- "minimalist_model"
  model <- suppressWarnings(read.campsis(file.path(getwd(), test_path(), "models/", regFilename)))

  dataset <- Dataset() %>%
    add(Observations(times = seq(0, 24, by = 0.5)))

  simulation <- expression(simulate(model = model, dataset = dataset, dest = destEngine, seed = seed))
  test <- expression(
    output_regression_test(results, output = "A_CENTRAL", filename = regFilename),
    spaghettiPlot(results, "A_CENTRAL")
  )
  campsis_test(simulation, test, env = environment())
})

Try the campsis package in your browser

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

campsis documentation built on Aug. 5, 2026, 9:07 a.m.