aboutsummaryrefslogtreecommitdiff
path: root/inst/tinytest/test_autojags.R
diff options
context:
space:
mode:
Diffstat (limited to 'inst/tinytest/test_autojags.R')
-rw-r--r--inst/tinytest/test_autojags.R11
1 files changed, 11 insertions, 0 deletions
diff --git a/inst/tinytest/test_autojags.R b/inst/tinytest/test_autojags.R
index 654c8ec..d8b6b84 100644
--- a/inst/tinytest/test_autojags.R
+++ b/inst/tinytest/test_autojags.R
@@ -42,3 +42,14 @@ ref <- readRDS("autojags_ref_codaonly.Rds")
# Remove time/date based elements
out$mcmc.info$elapsed.mins <- ref$mcmc.inf$elapsed.mins
expect_identical(out[-c(17,18,21)], ref[-c(17,18,21)])
+
+# Check recovery after process_output errors-----------------------------------
+# Setting DIC to -999 forces process_output to error for testing
+expect_message(nul<- capture.output(
+ out <- autojags(data = data, inits = inits, parameters.to.save = params,
+ model.file = modfile, n.chains = 3, n.adapt = 100, n.burnin=50,
+ iter.increment=10, n.thin = 2, verbose=FALSE, codaOnly=c("mu"), DIC=-999)))
+expect_inherits(out, "jagsUIbasic")
+expect_equal(coda::varnames(out$samples),
+ c("alpha","beta", "sigma", paste0("mu[",1:16,"]"),"deviance"))
+expect_equal(names(out), c("samples", "model"))