git: b4d7ad856dba - main - math/R-cran-lme4: Fix tests

From: Nuno Teixeira <eduardo_at_FreeBSD.org>
Date: Sun, 08 Mar 2026 01:19:30 UTC
The branch main has been updated by eduardo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b4d7ad856dbaf62d22fa5453147b1b89165857e2

commit b4d7ad856dbaf62d22fa5453147b1b89165857e2
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2026-03-08 01:18:22 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2026-03-08 01:19:19 +0000

    math/R-cran-lme4: Fix tests
    
    Apply upstream patch to fix tests.
---
 math/R-cran-lme4/Makefile             |  2 --
 math/R-cran-lme4/files/patch-fix-test | 31 +++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/math/R-cran-lme4/Makefile b/math/R-cran-lme4/Makefile
index 13bcebf776ac..5c06cbc5d011 100644
--- a/math/R-cran-lme4/Makefile
+++ b/math/R-cran-lme4/Makefile
@@ -26,8 +26,6 @@ TEST_DEPENDS=	R-cran-ggplot2>0:graphics/R-cran-ggplot2 \
 
 USES=		cran:auto-plist,compiles
 
-TESTING_UNSAFE=	https://github.com/lme4/lme4/issues/942
-
 pre-test:
 
 # Test depends not ported yet
diff --git a/math/R-cran-lme4/files/patch-fix-test b/math/R-cran-lme4/files/patch-fix-test
new file mode 100644
index 000000000000..1d1baacb55b1
--- /dev/null
+++ b/math/R-cran-lme4/files/patch-fix-test
@@ -0,0 +1,31 @@
+From f1888c31db92f03c93d1bf05ecca1ac8a43c0935 Mon Sep 17 00:00:00 2001
+From: Ben Bolker <bbolker@gmail.com>
+Date: Sat, 7 Mar 2026 10:59:42 -0500
+Subject: [PATCH] loosen tolerance in isSingular test [run ci]
+
+---
+ tests/testthat/test-isSingular.R | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git tests/testthat/test-isSingular.R tests/testthat/test-isSingular.R
+index 33d47579..7d41562a 100644
+--- tests/testthat/test-isSingular.R
++++ tests/testthat/test-isSingular.R
+@@ -21,7 +21,7 @@ test_that("checking singular fit for covariance", {
+   
+   test.reCovs <- c(test.us, test.diag, test.cs, test.homcs, test.ar1, test.hetar1)
+   
+-  ## tests should fail once one of the diagional entries is 0
++  ## tests should fail once one of the diagonal entries is 0
+   sapply(test.reCovs, function(i){
+     new_theta <- getTheta(i)
+     new_theta[1] <- 0
+@@ -74,7 +74,7 @@ test_that("checking singular fit for merMod", {
+                                      sigma = 2))[[1]]
+   mod2 <- suppressWarnings(lmer(form2, data = dat))
+   ## second one, should be an issue with group 1 as we set thetas = 0
+-  expect_equal(isSingular(mod2), TRUE)
++  expect_equal(isSingular(mod2, tol = 5e-4), TRUE)
+   
+   ## also need to consider the glmer case
+   form <- y ~ 1 + (1 + x1 | group1) + (1 + x2 | group2)