test_that("Plot functions run without throwing errors", { pdf(file = tempfile(fileext = ".pdf")) expect_silent(plot_sps_bxii_contour(type = "pdf", alpha1 = 2, beta1 = 3, alpha2 = 2, beta2 = 3, delta = 0.5, n_grid = 10)) expect_silent(plot_sps_bxii_contour(type = "cdf", alpha1 = 2, beta1 = 3, alpha2 = 2, beta2 = 3, delta = 0.5, n_grid = 10, filled = FALSE)) expect_silent(plot_sps_bxii_contour(type = "hrf", alpha1 = 2, beta1 = 3, alpha2 = 2, beta2 = 3, delta = 0.5, n_grid = 10)) # MCMC diagnostic plot mock_chain <- matrix(rnorm(500, mean = 2, sd = 0.2), nrow = 100, ncol = 5, dimnames = list(NULL, c("alpha1", "beta1", "alpha2", "beta2", "delta"))) mock_bayes <- list(chain = mock_chain) class(mock_bayes) <- "sps_bxii_bayes" expect_silent(plot_sps_bxii_mcmc(mock_bayes, type = "trace", par_names = "alpha1")) expect_silent(plot_sps_bxii_mcmc(mock_bayes, type = "density", par_names = "alpha1")) expect_silent(plot_sps_bxii_mcmc(mock_bayes, type = "autocorr", par_names = "alpha1")) dev.off() })