Skip to content

Commit

Permalink
Try using if condition for tests on CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
NeuroShepherd committed Nov 8, 2024
1 parent 2e190db commit 0b25bd1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/testthat/test-zzz_fix1.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

test_that("test .onLoad", {

is_chk <- Sys.getenv("_R_CHECK_PACKAGE_NAME_", "") != .packageName

if (is_chk) {
indep_session <- callr::r(function() {
ordinalsimr_opts_preload <- grep("ordinalsimr.", names(options()), value = TRUE) |>
purrr::set_names() |>
Expand Down Expand Up @@ -39,6 +41,7 @@ test_that("test .onLoad", {
expect_equal(indep_session$ordinalsimr_opts_postload$ordinalsimr.default_size_min, 30)
expect_equal(indep_session$ordinalsimr_opts_postload$ordinalsimr.default_size_max, 200)
expect_equal(indep_session$ordinalsimr_opts_postload$ordinalsimr.default_ratio, "50:50")
}


})

0 comments on commit 0b25bd1

Please sign in to comment.