From: Benjamin Auder Date: Fri, 17 Apr 2026 22:36:25 +0000 (+0200) Subject: Set seed for all unit tests X-Git-Url: https://git.auder.net/assets/bundles/doc/html/scripts/current/git-logo.png?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=morpheus.git Set seed for all unit tests --- diff --git a/pkg/tests/testthat/test-optimParams.R b/pkg/tests/testthat/test-optimParams.R index a8b8909..0a4e8d4 100644 --- a/pkg/tests/testthat/test-optimParams.R +++ b/pkg/tests/testthat/test-optimParams.R @@ -48,6 +48,7 @@ naive_f <- function(link, M1,M2,M3, p,β,b) # TODO: understand why delta is so large (should be 10^-6 10^-7 ...) test_that("naive computation provides the same result as vectorized computations", { + set.seed(7) h <- 1e-7 #for finite-difference tests n <- 10 for (dK in list( c(2,2), c(5,3))) @@ -88,6 +89,7 @@ test_that("naive computation provides the same result as vectorized computations test_that("W computed in C and in R are the same", { + set.seed(7) tol <- 1e-8 n <- 10 for (dK in list( c(2,2))) #, c(5,3)))