Nothing
library(testthat)
context("Test the declare argument of the simulate function")
seed <- 1
source(file.path(getwd(), test_path(), "test-utils.R"))
test_that("Declare argument with mrgsolve", {
model <- model_suite$testing$nonmem$advan4_trans4
model <- model %>% replace(Equation("KA", "THETA_KA*exp(ETA_KA + SOMETHING)"))
regFilename <- "simple_bolus"
dataset <- Dataset() %>%
add(Bolus(time = 0, amount = 1000, compartment = 1)) %>%
add(Observations(times = seq(0, 24, by = 0.5)))
dataset_regression_test(dataset, model, seed = seed, filename = regFilename)
tablefun <- ~ .x %>% dplyr::mutate(SOMETHING = 0)
test <- expression(
if (destEngine %in% c("rxode2")) {
# RxODE does not complain
results <- model %>% simulate(dataset, dest = destEngine, seed = seed, tablefun = tablefun)
output_regression_test(results, output = "CP", filename = regFilename)
},
if (destEngine %in% c("mrgsolve")) {
# mrgsolve complains and cannot build the model
expect_error(model %>% simulate(dataset, dest = destEngine, seed = seed, tablefun = tablefun))
# mrgsolve does not complain if SOMETHING variable is declared
results <- model %>%
simulate(
dataset,
dest = destEngine,
seed = seed,
tablefun = tablefun,
settings = Settings(Declare("SOMETHING"))
)
output_regression_test(results, output = "CP", filename = regFilename)
}
)
campsis_test(expression(), test, env = environment())
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.