diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R index 60f2b721..fc870e02 100644 --- a/tests/testthat/helper.R +++ b/tests/testthat/helper.R @@ -1,8 +1,22 @@ -# used to skip visual tests of SVGs on r-devel and r-oldrel -# because they can be slightly different than r-release occasionally -skip_if_not_r_release <- function() { - # first try just skipping on devel - testthat::skip_if(isTRUE(Sys.getenv("R_VERSION_TYPE") == "devel")) +# Used if necessary to skip visual tests of SVGs (using vdiffr) +# on different R versions because they can be slightly different - #testthat::skip_if_not(isTRUE(Sys.getenv("R_VERSION_TYPE") == "release")) +# R_VERSION_TYPE is set in the R-CMD-check.yaml GitHub Actions workflow file + +on_r_devel <- function() { + isTRUE(Sys.getenv("R_VERSION_TYPE") == "devel") +} +on_r_oldrel <- function() { + isTRUE(Sys.getenv("R_VERSION_TYPE") == "oldrel") +} + +skip_on_r_devel <- function() { + testthat::skip_if(on_r_devel()) +} +skip_on_r_oldrel <- function() { + testthat::skip_if(on_r_oldrel()) +} +skip_if_not_on_r_release <- function() { + skip_on_r_devel() + skip_on_r_oldrel() } diff --git a/tests/testthat/test-aesthetics.R b/tests/testthat/test-aesthetics.R index bf7130db..a6fd30e9 100644 --- a/tests/testthat/test-aesthetics.R +++ b/tests/testthat/test-aesthetics.R @@ -219,7 +219,7 @@ color_scheme_set() test_that("color_scheme_view renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() color_scheme_set() p_default <- color_scheme_view() diff --git a/tests/testthat/test-mcmc-diagnostics.R b/tests/testthat/test-mcmc-diagnostics.R index 0115ef7c..b1d3244e 100644 --- a/tests/testthat/test-mcmc-diagnostics.R +++ b/tests/testthat/test-mcmc-diagnostics.R @@ -109,7 +109,7 @@ test_that("mcmc_acf & mcmc_acf_bar throw correct errors", { test_that("mcmc_rhat renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() rhats <- seq(from = 1, to = 1.20, length.out = 10) @@ -123,7 +123,7 @@ test_that("mcmc_rhat renders correctly", { test_that("mcmc_rhat_hist renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() rhats <- seq(from = 1, to = 1.20, length.out = 10) @@ -138,7 +138,7 @@ test_that("mcmc_rhat_hist renders correctly", { test_that("mcmc_neff renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() neffs <- seq(from = 0, to = 1, length.out = 20) @@ -149,7 +149,7 @@ test_that("mcmc_neff renders correctly", { test_that("mcmc_neff_hist renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() neffs <- seq(from = 0, to = 1, length.out = 20) @@ -163,7 +163,7 @@ test_that("mcmc_neff_hist renders correctly", { test_that("mcmc_acf renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_acf(vdiff_dframe) vdiffr::expect_doppelganger("mcmc_acf (default)", p_base) @@ -175,7 +175,7 @@ test_that("mcmc_acf renders correctly", { test_that("mcmc_acf_bar renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_acf_bar(vdiff_dframe) vdiffr::expect_doppelganger("mcmc_acf_bar (default)", p_base) diff --git a/tests/testthat/test-mcmc-distributions.R b/tests/testthat/test-mcmc-distributions.R index ee77b479..7b2ae9fa 100644 --- a/tests/testthat/test-mcmc-distributions.R +++ b/tests/testthat/test-mcmc-distributions.R @@ -124,7 +124,7 @@ test_that("mcmc_* throws error if 1 chain but multiple chains required", { test_that("mcmc_hist renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_hist(vdiff_dframe, binwidth = 0.1) vdiffr::expect_doppelganger("mcmc_hist (default)", p_base) @@ -139,7 +139,7 @@ test_that("mcmc_hist renders correctly", { test_that("mcmc_dens renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_dens(vdiff_dframe) vdiffr::expect_doppelganger("mcmc_dens (default)", p_base) @@ -151,7 +151,7 @@ test_that("mcmc_dens renders correctly", { test_that("mcmc_dens_overlay renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_dens_overlay(vdiff_dframe_chains) vdiffr::expect_doppelganger("mcmc_dens_overlay (default)", p_base) @@ -160,7 +160,7 @@ test_that("mcmc_dens_overlay renders correctly", { test_that("mcmc_dens_chains renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_dens_chains(vdiff_dframe_chains) vdiffr::expect_doppelganger("mcmc_dens_chains (default)", p_base) @@ -169,7 +169,7 @@ test_that("mcmc_dens_chains renders correctly", { test_that("mcmc_hist_by_chain renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_hist_by_chain(vdiff_dframe_chains, binwidth = 0.5) vdiffr::expect_doppelganger("mcmc_hist_by_chain (default)", p_base) @@ -178,7 +178,7 @@ test_that("mcmc_hist_by_chain renders correctly", { test_that("mcmc_violin renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_violin(vdiff_dframe_chains) vdiffr::expect_doppelganger("mcmc_violin (default)", p_base) diff --git a/tests/testthat/test-mcmc-intervals.R b/tests/testthat/test-mcmc-intervals.R index efd4352e..ee4a8bc4 100644 --- a/tests/testthat/test-mcmc-intervals.R +++ b/tests/testthat/test-mcmc-intervals.R @@ -178,7 +178,7 @@ test_that("inconsistent probabilities raise warning (#138)", { test_that("mcmc_intervals renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_intervals(vdiff_dframe) vdiffr::expect_doppelganger("mcmc_intervals (default)", p_base) @@ -206,7 +206,7 @@ test_that("mcmc_intervals renders correctly", { test_that("mcmc_areas renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_areas(vdiff_dframe) vdiffr::expect_doppelganger("mcmc_areas (default)", p_base) @@ -240,7 +240,7 @@ test_that("mcmc_areas renders correctly", { test_that("mcmc_areas_ridges renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_areas_ridges(vdiff_dframe) vdiffr::expect_doppelganger("mcmc_areas_ridges (default)", p_base) diff --git a/tests/testthat/test-mcmc-nuts.R b/tests/testthat/test-mcmc-nuts.R index 394dcaaa..c9f52a98 100644 --- a/tests/testthat/test-mcmc-nuts.R +++ b/tests/testthat/test-mcmc-nuts.R @@ -97,7 +97,7 @@ source(test_path("data-for-mcmc-tests.R")) test_that("mcmc_nuts_acceptance renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_nuts_acceptance(vdiff_dframe_chains_np, vdiff_dframe_chains_lp) vdiffr::expect_doppelganger("mcmc_nuts_acceptance (default)", p_base) @@ -109,7 +109,7 @@ test_that("mcmc_nuts_acceptance renders correctly", { test_that("mcmc_nuts_divergence renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_nuts_divergence(vdiff_dframe_chains_np, vdiff_dframe_chains_lp) vdiffr::expect_doppelganger("mcmc_nuts_divergence (default)", p_base) @@ -121,7 +121,7 @@ test_that("mcmc_nuts_divergence renders correctly", { test_that("mcmc_nuts_treedepth renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_nuts_treedepth(vdiff_dframe_chains_np, vdiff_dframe_chains_lp) vdiffr::expect_doppelganger("mcmc_nuts_treedepth (default)", p_base) @@ -133,7 +133,7 @@ test_that("mcmc_nuts_treedepth renders correctly", { test_that("mcmc_nuts_stepsize renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_nuts_stepsize(vdiff_dframe_chains_np, vdiff_dframe_chains_lp) vdiffr::expect_doppelganger("mcmc_nuts_stepsize (default)", p_base) @@ -145,7 +145,7 @@ test_that("mcmc_nuts_stepsize renders correctly", { test_that("mcmc_nuts_energy renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_nuts_energy(vdiff_dframe_chains_np, vdiff_dframe_chains_lp, binwidth = 10) vdiffr::expect_doppelganger("mcmc_nuts_energy (default)", p_base) diff --git a/tests/testthat/test-mcmc-recover.R b/tests/testthat/test-mcmc-recover.R index 51f00852..a545caa8 100644 --- a/tests/testthat/test-mcmc-recover.R +++ b/tests/testthat/test-mcmc-recover.R @@ -106,7 +106,7 @@ test_that("mcmc_recover_hist returns a ggplot object", { test_that("mcmc_recover_hist renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_recover_hist(draws, true, binwidth = 0.01) vdiffr::expect_doppelganger("mcmc_recover_hist (default)", p_base) @@ -115,7 +115,7 @@ test_that("mcmc_recover_hist renders correctly", { test_that("mcmc_recover_intervals renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_recover_intervals(draws, true) vdiffr::expect_doppelganger("mcmc_recover_intervals (default)", p_base) @@ -127,7 +127,7 @@ test_that("mcmc_recover_intervals renders correctly", { test_that("mcmc_recover_scatter renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_recover_scatter(draws, true) vdiffr::expect_doppelganger("mcmc_recover_scatter (default)", p_base) diff --git a/tests/testthat/test-mcmc-scatter-and-parcoord.R b/tests/testthat/test-mcmc-scatter-and-parcoord.R index e49f668b..7ec8b3f9 100644 --- a/tests/testthat/test-mcmc-scatter-and-parcoord.R +++ b/tests/testthat/test-mcmc-scatter-and-parcoord.R @@ -373,7 +373,7 @@ test_that("parcoord_style_np throws correct errors", { test_that("mcmc_scatter renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_scatter(vdiff_dframe_chains) vdiffr::expect_doppelganger("mcmc_scatter (default)", p_base) @@ -396,7 +396,7 @@ test_that("mcmc_hex renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") skip_if_not_installed("hexbin") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_hex(vdiff_dframe, pars = c("V1", "V2")) vdiffr::expect_doppelganger("mcmc_hex (default)", p_base) @@ -412,7 +412,7 @@ test_that("mcmc_hex renders correctly", { test_that("mcmc_parcoord renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_parcoord(vdiff_dframe_chains) vdiffr::expect_doppelganger("mcmc_parcoord (default)", p_base) @@ -430,7 +430,7 @@ test_that("mcmc_pairs renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") skip_if_not_installed("hexbin") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_pairs(vdiff_dframe_chains) vdiffr::expect_doppelganger("mcmc_pairs (default)", p_base) diff --git a/tests/testthat/test-mcmc-traces.R b/tests/testthat/test-mcmc-traces.R index f9f9140e..d7ba2b39 100644 --- a/tests/testthat/test-mcmc-traces.R +++ b/tests/testthat/test-mcmc-traces.R @@ -116,7 +116,7 @@ test_that("mcmc_trace 'np' argument works", { test_that("mcmc_trace renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_trace(vdiff_dframe_chains, pars = c("V1", "V2")) p_one_param <- mcmc_trace(vdiff_dframe_chains, pars = "V1") @@ -139,7 +139,7 @@ test_that("mcmc_trace renders correctly", { test_that("mcmc_rank_overlay renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_rank_overlay(vdiff_dframe_chains, pars = c("V1", "V2")) p_base_ref <- mcmc_rank_overlay( @@ -169,7 +169,7 @@ test_that("mcmc_rank_overlay renders correctly", { test_that("mcmc_rank_hist renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_rank_hist(vdiff_dframe_chains, pars = c("V1", "V2")) p_base_ref <- mcmc_rank_hist( @@ -202,7 +202,7 @@ test_that("mcmc_rank_hist renders correctly", { test_that("mcmc_trace_highlight renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_trace_highlight( vdiff_dframe_chains, @@ -231,7 +231,7 @@ test_that("mcmc_trace_highlight renders correctly", { test_that("mcmc_rank_ecdf renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_rank_ecdf(vdiff_dframe_chains, pars = c("V1", "V2")) p_one_param <- mcmc_rank_ecdf(vdiff_dframe_chains, pars = "V1") @@ -260,7 +260,7 @@ test_that("mcmc_rank_ecdf renders correctly", { test_that("mcmc_trace with 'np' renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- mcmc_trace( vdiff_dframe_chains, diff --git a/tests/testthat/test-ppc-censoring.R b/tests/testthat/test-ppc-censoring.R index 023e0246..f78639cb 100644 --- a/tests/testthat/test-ppc-censoring.R +++ b/tests/testthat/test-ppc-censoring.R @@ -32,7 +32,7 @@ test_that("ppc_km_overlay renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") skip_if_not_installed("ggfortify") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_km_overlay(vdiff_y2, vdiff_yrep2, status_y = vdiff_status_y2) vdiffr::expect_doppelganger("ppc_km_overlay (default)", p_base) @@ -50,7 +50,7 @@ test_that("ppc_km_overlay_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") skip_if_not_installed("ggfortify") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_km_overlay_grouped(vdiff_y2, vdiff_yrep2, vdiff_group2, status_y = vdiff_status_y2) diff --git a/tests/testthat/test-ppc-discrete.R b/tests/testthat/test-ppc-discrete.R index 5c37a9ca..2a1d5285 100644 --- a/tests/testthat/test-ppc-discrete.R +++ b/tests/testthat/test-ppc-discrete.R @@ -104,7 +104,7 @@ test_that("ppc_rootogram errors if y/yrep not counts", { test_that("ppc_bars renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_bars(vdiff_y2, vdiff_yrep2) vdiffr::expect_doppelganger("ppc_bars (default)", p_base) @@ -138,7 +138,7 @@ test_that("ppc_bars renders correctly", { test_that("ppc_bars_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_bars_grouped(vdiff_y2, vdiff_yrep2, vdiff_group2) vdiffr::expect_doppelganger("ppc_bars_grouped (default)", p_base) @@ -160,7 +160,7 @@ test_that("ppc_bars_grouped renders correctly", { test_that("ppc_rootogram renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_rootogram(vdiff_y2, vdiff_yrep2) vdiffr::expect_doppelganger("ppc_rootogram (default)", p_base) diff --git a/tests/testthat/test-ppc-distributions.R b/tests/testthat/test-ppc-distributions.R index b5b88e04..e544e144 100644 --- a/tests/testthat/test-ppc-distributions.R +++ b/tests/testthat/test-ppc-distributions.R @@ -91,7 +91,7 @@ test_that("ppc_violin_grouped returns a ggplot object", { test_that("ppc_hist renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_hist(vdiff_y, vdiff_yrep[1:8, ]) vdiffr::expect_doppelganger("ppc_hist (default)", p_base) @@ -110,7 +110,7 @@ test_that("ppc_hist renders correctly", { test_that("ppc_freqpoly renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_freqpoly(vdiff_y, vdiff_yrep[1:8, ]) vdiffr::expect_doppelganger("ppc_freqpoly (default)", p_base) @@ -142,7 +142,7 @@ test_that("ppc_freqpoly renders correctly", { test_that("ppc_freqpoly_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_freqpoly_grouped(vdiff_y, vdiff_yrep[1:3, ], vdiff_group) vdiffr::expect_doppelganger("ppc_freqpoly_grouped (default)", p_base) @@ -155,7 +155,7 @@ test_that("ppc_freqpoly_grouped renders correctly", { test_that("ppc_boxplot renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_boxplot(vdiff_y, vdiff_yrep[1:8, ]) vdiffr::expect_doppelganger("ppc_boxplot (default)", p_base) @@ -180,7 +180,7 @@ test_that("ppc_boxplot renders correctly", { test_that("ppc_ecdf_overlay renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_ecdf_overlay(vdiff_y2, vdiff_yrep2) vdiffr::expect_doppelganger("ppc_ecdf_overlay (default)", p_base) @@ -202,7 +202,7 @@ test_that("ppc_ecdf_overlay renders correctly", { test_that("ppc_ecdf_overlay_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_ecdf_overlay_grouped(vdiff_y2, vdiff_yrep2, vdiff_group2) vdiffr::expect_doppelganger("ppc_ecdf_overlay_grouped (default)", p_base) @@ -225,7 +225,7 @@ test_that("ppc_ecdf_overlay_grouped renders correctly", { test_that("ppc_dens renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_dens(vdiff_y, vdiff_yrep[1:8, ]) vdiffr::expect_doppelganger("ppc_dens (default)", p_base) @@ -238,7 +238,7 @@ test_that("ppc_dens renders correctly", { test_that("ppc_dens_overlay renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_dens_overlay(vdiff_y, vdiff_yrep) vdiffr::expect_doppelganger("ppc_dens_overlay (default)", p_base) @@ -257,7 +257,7 @@ test_that("ppc_dens_overlay renders correctly", { test_that("ppc_dens_overlay_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_dens_overlay_grouped(vdiff_y, vdiff_yrep, vdiff_group) vdiffr::expect_doppelganger("ppc_dens_overlay_grouped (default)", p_base) @@ -280,7 +280,7 @@ test_that("ppc_violin_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not(getRversion() >= "3.6.0") testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_violin_grouped(vdiff_y, vdiff_yrep, vdiff_group) vdiffr::expect_doppelganger("ppc_violin_grouped (default)", p_base) @@ -312,7 +312,7 @@ test_that("ppc_violin_grouped renders correctly", { test_that("ppc_pit_ecdf, ppc_pit_ecdf_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_pit_ecdf(y, yrep, interpolate_adj = FALSE) g_base <- ppc_pit_ecdf_grouped(y, yrep, group = group, interpolate_adj = FALSE) diff --git a/tests/testthat/test-ppc-errors.R b/tests/testthat/test-ppc-errors.R index de24eecb..fdf20d7d 100644 --- a/tests/testthat/test-ppc-errors.R +++ b/tests/testthat/test-ppc-errors.R @@ -66,7 +66,7 @@ test_that("bin_errors works for edge cases", { test_that("ppc_error_hist renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_error_hist(vdiff_y, vdiff_yrep[1:3, ]) vdiffr::expect_doppelganger("ppc_error_hist (default)", p_base) @@ -75,7 +75,7 @@ test_that("ppc_error_hist renders correctly", { test_that("ppc_error_hist_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_error_hist_grouped(vdiff_y, vdiff_yrep[1:3, ], vdiff_group) vdiffr::expect_doppelganger("ppc_error_hist_grouped (default)", p_base) @@ -84,7 +84,7 @@ test_that("ppc_error_hist_grouped renders correctly", { test_that("ppc_error_scatter renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_error_scatter(vdiff_y, vdiff_yrep[1:3, ]) vdiffr::expect_doppelganger("ppc_error_scatter (default)", p_base) @@ -93,7 +93,7 @@ test_that("ppc_error_scatter renders correctly", { test_that("ppc_error_scatter_avg renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_error_scatter_avg(vdiff_y, vdiff_yrep) vdiffr::expect_doppelganger("ppc_error_scatter_avg (default)", p_base) @@ -102,7 +102,7 @@ test_that("ppc_error_scatter_avg renders correctly", { test_that("ppc_error_scatter_avg_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_error_scatter_avg_grouped(vdiff_y, vdiff_yrep, vdiff_group) vdiffr::expect_doppelganger("ppc_error_scatter_avg_grouped (default)", p_base) @@ -111,7 +111,7 @@ test_that("ppc_error_scatter_avg_grouped renders correctly", { test_that("ppc_error_scatter_avg_vs_x renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_error_scatter_avg_vs_x(vdiff_y, vdiff_yrep, x = seq_along(vdiff_y)) vdiffr::expect_doppelganger("ppc_error_scatter_avg_vs_x (default)", p_base) @@ -120,7 +120,7 @@ test_that("ppc_error_scatter_avg_vs_x renders correctly", { test_that("ppc_error_binned renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() rbeta2 <- function(n, mu, phi) { a <- mu * phi diff --git a/tests/testthat/test-ppc-intervals.R b/tests/testthat/test-ppc-intervals.R index f5ae5ec3..d1d7aa9d 100644 --- a/tests/testthat/test-ppc-intervals.R +++ b/tests/testthat/test-ppc-intervals.R @@ -108,7 +108,7 @@ test_that("ppc_intervals_data does math correctly", { test_that("ppc_intervals renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_intervals(vdiff_y, vdiff_yrep) vdiffr::expect_doppelganger("ppc_intervals (default)", p_base) @@ -133,7 +133,7 @@ test_that("ppc_intervals renders correctly", { test_that("ppc_intervals_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_intervals_grouped(vdiff_y, vdiff_yrep, group = vdiff_group) vdiffr::expect_doppelganger("ppc_intervals_grouped (default)", p_base) @@ -159,7 +159,7 @@ test_that("ppc_intervals_grouped renders correctly", { test_that("ppc_ribbon renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_ribbon(vdiff_y, vdiff_yrep) vdiffr::expect_doppelganger("ppc_ribbon (default)", p_base) @@ -193,7 +193,7 @@ test_that("ppc_ribbon renders correctly", { test_that("ppc_ribbon_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_ribbon_grouped(vdiff_y, vdiff_yrep, group = vdiff_group) vdiffr::expect_doppelganger("ppc_ribbon_grouped (default)", p_base) diff --git a/tests/testthat/test-ppc-loo.R b/tests/testthat/test-ppc-loo.R index 566af941..47afe69d 100644 --- a/tests/testthat/test-ppc-loo.R +++ b/tests/testthat/test-ppc-loo.R @@ -167,7 +167,7 @@ test_that("ppc_loo_pit_overlay renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") skip_if_not_installed("loo") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- suppressMessages(ppc_loo_pit_overlay(vdiff_loo_y, vdiff_loo_yrep, vdiff_loo_lw)) vdiffr::expect_doppelganger("ppc_loo_pit_overlay (default)", p_base) @@ -185,7 +185,7 @@ test_that("ppc_loo_pit_qq renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") skip_if_not_installed("loo") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_loo_pit_qq(vdiff_loo_y, vdiff_loo_yrep, vdiff_loo_lw) vdiffr::expect_doppelganger("ppc_loo_pit_qq (default)", p_base) @@ -195,7 +195,7 @@ test_that("ppc_loo_intervals renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") skip_if_not_installed("loo") - skip_if_not_r_release() + skip_on_r_oldrel() psis_object <- suppressWarnings(loo::psis(-vdiff_loo_lw)) p_base <- ppc_loo_intervals( @@ -227,7 +227,7 @@ test_that("ppc_loo_ribbon renders correctly", { skip_on_cran() skip_if_not_installed("vdiffr") skip_if_not_installed("loo") - skip_if_not_r_release() + skip_on_r_oldrel() psis_object <- suppressWarnings(loo::psis(-vdiff_loo_lw)) p_base <- ppc_loo_ribbon( diff --git a/tests/testthat/test-ppc-scatterplots.R b/tests/testthat/test-ppc-scatterplots.R index 0687b4a1..2640472e 100644 --- a/tests/testthat/test-ppc-scatterplots.R +++ b/tests/testthat/test-ppc-scatterplots.R @@ -35,7 +35,7 @@ test_that("ppc_scatter_avg_grouped returns a ggplot object", { test_that("ppc_scatter renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_scatter(vdiff_y, vdiff_yrep[1:6, ]) vdiffr::expect_doppelganger("ppc_scatter (default)", p_base) @@ -55,7 +55,7 @@ test_that("ppc_scatter renders correctly", { test_that("ppc_scatter_avg renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_scatter_avg(vdiff_y, vdiff_yrep) vdiffr::expect_doppelganger("ppc_scatter_avg (default)", p_base) @@ -75,7 +75,7 @@ test_that("ppc_scatter_avg renders correctly", { test_that("ppc_scatter_avg_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_scatter_avg_grouped(vdiff_y, vdiff_yrep, vdiff_group) vdiffr::expect_doppelganger("ppc_scatter_avg_grouped (default)", p_base) diff --git a/tests/testthat/test-ppc-test-statistics.R b/tests/testthat/test-ppc-test-statistics.R index 8c4a09bf..ab8b7166 100644 --- a/tests/testthat/test-ppc-test-statistics.R +++ b/tests/testthat/test-ppc-test-statistics.R @@ -99,7 +99,7 @@ test_that("ppc_stat_data and ppd_stat_data throw correct errors", { test_that("ppc_stat renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_stat(vdiff_y, vdiff_yrep, binwidth = 0.05) + yaxis_text() vdiffr::expect_doppelganger("ppc_stat (default)", p_base) @@ -133,7 +133,7 @@ test_that("ppc_stat renders correctly", { test_that("ppc_stat_2d renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_stat_2d(vdiff_y, vdiff_yrep) vdiffr::expect_doppelganger("ppc_stat_2d (default)", p_base) @@ -167,7 +167,7 @@ test_that("ppc_stat_2d renders correctly", { test_that("ppc_stat_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_stat_grouped(vdiff_y, vdiff_yrep, vdiff_group, binwidth = 0.05) vdiffr::expect_doppelganger("ppc_stat_grouped (default)", p_base) @@ -203,7 +203,7 @@ test_that("ppc_stat_grouped renders correctly", { test_that("ppc_stat_freqpoly_grouped renders correctly", { testthat::skip_on_cran() testthat::skip_if_not_installed("vdiffr") - skip_if_not_r_release() + skip_on_r_oldrel() p_base <- ppc_stat_freqpoly_grouped(vdiff_y, vdiff_yrep, vdiff_group, binwidth = 0.05) vdiffr::expect_doppelganger("ppc_stat_freqpoly_grouped (default)", p_base)