aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DESCRIPTION2
-rw-r--r--tests/testthat/convergence_fits_synth_const.txt0
-rw-r--r--tests/testthat/convergence_hfits_synth.txt0
-rw-r--r--tests/testthat/illparms_hfits_synth.txt8
-rw-r--r--tests/testthat/print_fits_synth_const.txt11
-rw-r--r--tests/testthat/print_hfits_synth.txt9
-rw-r--r--tests/testthat/test_mhmkin.R11
7 files changed, 35 insertions, 6 deletions
diff --git a/DESCRIPTION b/DESCRIPTION
index 6bf960f2..118ceaae 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -24,7 +24,7 @@ Description: Calculation routines based on the FOCUS Kinetics Report (2006,
purpose.
Depends: R (>= 2.15.1),
Imports: stats, graphics, methods, parallel, deSolve, R6, inline (>= 0.3.19),
- numDeriv, lmtest, pkgbuild, nlme (>= 3.1-151), purrr, saemix (>= 3.0)
+ numDeriv, lmtest, pkgbuild, nlme (>= 3.1-151), purrr, saemix (>= 3.1)
Suggests: knitr, rbenchmark, tikzDevice, testthat, rmarkdown, covr, vdiffr,
benchmarkme, tibble, stats4
License: GPL
diff --git a/tests/testthat/convergence_fits_synth_const.txt b/tests/testthat/convergence_fits_synth_const.txt
deleted file mode 100644
index e69de29b..00000000
--- a/tests/testthat/convergence_fits_synth_const.txt
+++ /dev/null
diff --git a/tests/testthat/convergence_hfits_synth.txt b/tests/testthat/convergence_hfits_synth.txt
deleted file mode 100644
index e69de29b..00000000
--- a/tests/testthat/convergence_hfits_synth.txt
+++ /dev/null
diff --git a/tests/testthat/illparms_hfits_synth.txt b/tests/testthat/illparms_hfits_synth.txt
index e69de29b..affd1318 100644
--- a/tests/testthat/illparms_hfits_synth.txt
+++ b/tests/testthat/illparms_hfits_synth.txt
@@ -0,0 +1,8 @@
+ error
+degradation const
+ SFO
+ FOMC sd(log_alpha), sd(log_beta)
+ error
+degradation tc
+ SFO sd(parent_0)
+ FOMC sd(parent_0), sd(log_alpha), sd(log_beta)
diff --git a/tests/testthat/print_fits_synth_const.txt b/tests/testthat/print_fits_synth_const.txt
new file mode 100644
index 00000000..2ea1f133
--- /dev/null
+++ b/tests/testthat/print_fits_synth_const.txt
@@ -0,0 +1,11 @@
+<mmkin> object
+Status of individual fits:
+
+ dataset
+model 1 2 3 4 5 6
+ SFO OK OK OK OK OK OK
+ FOMC C C OK OK OK OK
+
+C: Optimisation did not converge:
+false convergence (8)
+OK: No warnings
diff --git a/tests/testthat/print_hfits_synth.txt b/tests/testthat/print_hfits_synth.txt
new file mode 100644
index 00000000..9af1cbcd
--- /dev/null
+++ b/tests/testthat/print_hfits_synth.txt
@@ -0,0 +1,9 @@
+<mhmkin> object
+Status of individual fits:
+
+ error
+degradation const tc
+ SFO OK OK
+ FOMC OK OK
+
+OK: Fit terminated successfully
diff --git a/tests/testthat/test_mhmkin.R b/tests/testthat/test_mhmkin.R
index 5243f971..e059948a 100644
--- a/tests/testthat/test_mhmkin.R
+++ b/tests/testthat/test_mhmkin.R
@@ -10,20 +10,21 @@ test_that("Multiple hierarchical kinetic models can be fitted and diagnosed", {
update(fits_synth_const, error_model = "tc"))
expect_known_output(
- convergence(fits_synth_const),
- "convergence_fits_synth_const.txt")
+ print(fits_synth_const),
+ "print_fits_synth_const.txt")
hfits <- mhmkin(list(fits_synth_const, fits_synth_tc))
expect_known_output(
- convergence(hfits),
- "convergence_hfits_synth.txt")
+ print(hfits),
+ "print_hfits_synth.txt")
expect_known_output(
- illparms(hfits),
+ print(illparms(hfits)),
"illparms_hfits_synth.txt")
expect_equal(which.min(AIC(hfits)), 3)
+ expect_equal(which.min(BIC(hfits)), 3)
hfit_sfo_tc <- update(hfits[["SFO", "tc"]],
covariance.model = diag(c(0, 1)))

Contact - Imprint