tests/testthat/test-saveConfig.R

test_that("saving/loading a config works as expected", {
  cfg <- list(title = "default", gms = list(switch1 = TRUE, switch2 = 1),
              input = c(a = 12, b = "bla"), weird = character(0))
  expect_identical(cfg, loadConfig(saveConfig(cfg)))
  file <- tempfile()
  expect_silent(saveConfig(cfg, file))
  expect_identical(cfg, loadConfig(file))
  unlink(file)
})

Try the gms package in your browser

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

gms documentation built on June 29, 2024, 9:07 a.m.