diff options
author | Ken Kellner <ken@kenkellner.com> | 2023-12-04 14:27:35 -0500 |
---|---|---|
committer | Ken Kellner <ken@kenkellner.com> | 2023-12-04 14:27:35 -0500 |
commit | 7be9a09e5bbcc9b03ffa06353bd7b5bab216cd32 (patch) | |
tree | af459e02f795a828a914a6f358392b8cfdfbf4d2 | |
parent | 9e8f0236e10da1f646809280788b2abeb1b375cc (diff) |
Fix test problem
-rw-r--r-- | .github/workflows/R-CMD-check.yaml | 2 | ||||
-rw-r--r-- | inst/tinytest/test_print.R | 42 |
2 files changed, 7 insertions, 37 deletions
diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 39efba7..f7a31f8 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -22,8 +22,6 @@ jobs: fail-fast: false matrix: config: - - {os: windows-latest, r: 'release'} - - {os: macOS-latest, r: 'release'} - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} diff --git a/inst/tinytest/test_print.R b/inst/tinytest/test_print.R index a45e452..2f765ed 100644 --- a/inst/tinytest/test_print.R +++ b/inst/tinytest/test_print.R @@ -2,41 +2,13 @@ out <- readRDS("longley_reference_fit.Rds") # Check standard output pr <- capture.output(print(out)) -ref <- c("JAGS output for model '/tmp/RtmpfjJ4CS/fileba59500bfcfc', generated by jagsUI.", -"Estimates based on 3 chains of 1000 iterations,", "adaptation = 100 iterations (sufficient),", -"burn-in = 500 iterations and thin rate = 2,", "yielding 750 total samples from the joint posterior. ", -"MCMC ran for 0.001 minutes at time 2023-12-02 19:31:22.886591.", -"", " mean sd 2.5% 50% 97.5% overlap0 f Rhat n.eff", -"alpha 51.876 0.745 50.384 51.891 53.380 FALSE 1 1.000 750", -"beta 0.035 0.002 0.031 0.035 0.038 FALSE 1 1.000 750", -"sigma 0.728 0.154 0.506 0.700 1.102 FALSE 1 0.998 750", -"mu[1] 59.997 0.340 59.323 60.002 60.680 FALSE 1 1.001 750", -"mu[2] 60.869 0.302 60.275 60.873 61.461 FALSE 1 1.001 750", -"mu[3] 60.821 0.304 60.221 60.825 61.418 FALSE 1 1.001 750", -"mu[4] 61.741 0.267 61.234 61.741 62.263 FALSE 1 1.001 750", -"mu[5] 63.280 0.218 62.872 63.276 63.704 FALSE 1 1.000 750", -"mu[6] 63.904 0.204 63.504 63.900 64.306 FALSE 1 1.000 750", -"mu[7] 64.542 0.195 64.158 64.536 64.933 FALSE 1 1.000 750", -"mu[8] 64.463 0.195 64.078 64.458 64.857 FALSE 1 1.000 750", -"mu[9] 65.654 0.193 65.279 65.655 66.027 FALSE 1 1.000 750", -"mu[10] 66.407 0.203 66.021 66.406 66.802 FALSE 1 1.000 750", -"mu[11] 67.224 0.221 66.797 67.226 67.641 FALSE 1 1.000 750", -"mu[12] 67.286 0.223 66.854 67.287 67.704 FALSE 1 1.000 750", -"mu[13] 68.609 0.266 68.098 68.613 69.142 FALSE 1 1.000 750", -"mu[14] 69.298 0.293 68.739 69.301 69.867 FALSE 1 1.000 750", -"mu[15] 69.838 0.316 69.229 69.844 70.443 FALSE 1 1.000 750", -"mu[16] 71.111 0.373 70.383 71.111 71.820 FALSE 1 1.000 750", -"deviance 33.463 2.889 30.084 32.649 41.260 FALSE 1 0.999 750", -"", "Successful convergence based on Rhat values (all < 1.1). ", -"Rhat is the potential scale reduction factor (at convergence, Rhat=1). ", -"For each parameter, n.eff is a crude measure of effective sample size. ", -"", "overlap0 checks if 0 falls in the parameter's 95% credible interval.", -"f is the proportion of the posterior with the same sign as the mean;", -"i.e., our confidence that the parameter is positive or negative.", -"", "DIC info: (pD = var(deviance)/2) ", "pD = 4.2 and DIC = 37.647 ", -"DIC is an estimate of expected predictive error (lower is better)." -) -expect_identical(pr, ref) +expect_true(grepl(" 750 ", pr[5])) +expect_true(grepl("Rhat", pr[8])) +expect_true(grepl("n.eff", pr[8])) +expect_true(grepl(" 51.876 ", pr[9])) +expect_true(grepl("Successful", pr[30])) +expect_true(grepl("overlap0", pr[34])) +expect_true(grepl("DIC", pr[38])) # Rounded pr2 <- capture.output(print(out, digits=2)) |