diff --git a/DESCRIPTION b/DESCRIPTION index 2529a0d..60a70b2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ICIKendallTau Title: Calculates information-content-informed Kendall-tau -Version: 1.2.6 +Version: 1.2.7 Authors@R: c( person( given = c("Robert", "M"), diff --git a/tests/testthat/test-kendall-tau.R b/tests/testthat/test-kendall-tau.R index 147086f..338e330 100644 --- a/tests/testthat/test-kendall-tau.R +++ b/tests/testthat/test-kendall-tau.R @@ -77,25 +77,26 @@ test_that("large kendall returns correct", { expect_snapshot(ici_val) }) -if (run_long_kendallt) { - test_that("big kendall works", { - x = sort(rnorm(50000)) - y = x + 1 - x[1:5000] = NA - - t1 = ici_kt(x, y, perspective = "global") - t2 = ICIKendallTau:::ici_kt_pairs(x, y, perspective = "global") - expect_equal(t1[c(1, 2)], t2) - }) +test_that("big kendall works", { + skip_if_not(run_long_kendallt) + x = sort(rnorm(50000)) + y = x + 1 + x[1:5000] = NA + + t1 = ici_kt(x, y, perspective = "global") + t2 = ICIKendallTau:::ici_kt_pairs(x, y, perspective = "global") + expect_equal(t1[c(1, 2)], t2) +}) - test_that("lots of kendall works", { - x = matrix(rnorm(500000), 5000, 100) - colnames(x) = paste0('s', seq_len(ncol(x))) +test_that("lots of kendall works", { + skip_if_not(run_long_kendallt) + x = matrix(rnorm(500000), 5000, 100) + colnames(x) = paste0('s', seq_len(ncol(x))) + + t1 = ici_kendalltau(x) + expect_lt(t1$run_time, 9) +}) - t1 = ici_kendalltau(x) - expect_lt(t1$run_time, 9) - }) -} test_that("include_only works as intended", { diff --git a/tests/testthat/test-logging.R b/tests/testthat/test-logging.R index f5be459..a22adec 100644 --- a/tests/testthat/test-logging.R +++ b/tests/testthat/test-logging.R @@ -1,4 +1,10 @@ +run_long_kendallt = as.logical(Sys.getenv("run_long_kendallt")) +if (is.na(run_long_kendallt)) { + run_long_kendallt = FALSE +} + test_that("logger detection works", { + skip_if_not(run_long_kendallt) new_lib = tempfile() dir.create(new_lib) withr::with_libpaths(new_lib, {