tests/testthat/test-run.R

## This test expects the directory structure and example files to be present, 
## so it has to be run after `setup_directory`, which is run in `test-setup.R`.
test_that("growR_run_loop with example config", {
  envs = read_config(file.path(.tmpdir(), "example_config.txt"), 
                     input_dir = file.path(.tmpdir(), "input"))
  # Reduce run time by reducing the number of years
  for (env in envs) {
    env$years = env$years[[1]]
  }
  expect_no_error(growR_run_loop(envs))
  unlink(.tmpdir(), recursive = TRUE)
})

Try the growR package in your browser

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

growR documentation built on May 29, 2024, 9:12 a.m.