From 553d4b763a79f880e9de138a78de624abb15754e Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 25 Oct 2022 22:11:05 +0200 Subject: Avoid another platform dependence Caused by the fact that printing error model parameters in nlme summaries do not honor the digits argument. --- tests/testthat/summary_dfop_nlme_1.txt | 4 ++-- tests/testthat/test_mixed.R | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/testthat/summary_dfop_nlme_1.txt b/tests/testthat/summary_dfop_nlme_1.txt index 773be488..1ea5f3b7 100644 --- a/tests/testthat/summary_dfop_nlme_1.txt +++ b/tests/testthat/summary_dfop_nlme_1.txt @@ -54,8 +54,8 @@ Variance function: Structure: Constant plus proportion of variance covariate Formula: ~fitted(.) Parameter estimates: - const prop - 0.92275475 -0.04804649 + const prop + 0.9227564 -0.0480500 Backtransformed parameters with asymmetric confidence intervals: lower est. upper diff --git a/tests/testthat/test_mixed.R b/tests/testthat/test_mixed.R index 6fb06656..8f4f3ae3 100644 --- a/tests/testthat/test_mixed.R +++ b/tests/testthat/test_mixed.R @@ -10,6 +10,10 @@ test_that("Print methods work", { test_that("nlme results are reproducible to some degree", { + dfop_nlme_1$modelStruct$varStruct$const <- + signif(dfop_nlme_1$modelStruct$varStruct$const, 4) + dfop_nlme_1$modelStruct$varStruct$prop <- + signif(dfop_nlme_1$modelStruct$varStruct$prop, 4) test_summary <- summary(dfop_nlme_1) test_summary$nlmeversion <- "Dummy 0.0 for testing" test_summary$mkinversion <- "Dummy 0.0 for testing" @@ -18,6 +22,7 @@ test_that("nlme results are reproducible to some degree", { test_summary$date.summary <- "Dummy date for testing" test_summary$time <- c(elapsed = "test time 0") + print(test_summary, digits = 1) expect_known_output(print(test_summary, digits = 1), "summary_dfop_nlme_1.txt") # The biphasic example data illustrate that DFOP parameters are difficult to -- cgit v1.2.1