From 75ba8574d61536f8a8b212eecb4439d4479544b5 Mon Sep 17 00:00:00 2001 From: jpquast Date: Sat, 2 Nov 2024 17:10:13 +0100 Subject: [PATCH] Make test dependent on limma version --- tests/testthat/test-workflow.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-workflow.R b/tests/testthat/test-workflow.R index 005f64e..f97cb54 100644 --- a/tests/testthat/test-workflow.R +++ b/tests/testthat/test-workflow.R @@ -326,8 +326,13 @@ test_that("calculate_diff_abundance works", { expect_equal(ncol(diff_moderated), 13) expect_equal(ncol(diff_proDA), 12) expect_equal(round(min(diff_mean_sd$adj_pval, na.rm = TRUE), digits = 9), 0.00758761) - expect_equal(round(min(diff_moderated$adj_pval, na.rm = TRUE), digits = 9), 3.87e-05) expect_equal(round(min(diff_proDA$adj_pval, na.rm = TRUE), digits = 5), 0.00125) + + if (packageVersion("limma") < "3.61.8") { + expect_equal(round(min(diff_moderated$adj_pval, na.rm = TRUE), digits = 9), 3.87e-05) + } else { + expect_equal(round(min(diff_moderated$adj_pval, na.rm = TRUE), digits = 9), 5.76e-05) + } } })