aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testthat')
-rw-r--r--tests/testthat/setup_script.R11
-rw-r--r--tests/testthat/test_analytical.R14
2 files changed, 20 insertions, 5 deletions
diff --git a/tests/testthat/setup_script.R b/tests/testthat/setup_script.R
index 58e328cd..def52697 100644
--- a/tests/testthat/setup_script.R
+++ b/tests/testthat/setup_script.R
@@ -40,16 +40,19 @@ fits <- mmkin(models,
# One metabolite
SFO_SFO <- mkinmod(parent = mkinsub("SFO", to = "m1"),
- m1 = mkinsub("SFO"),
- use_of_ff = "min", quiet = TRUE)
+ m1 = mkinsub("SFO"),
+ use_of_ff = "min", quiet = TRUE)
SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", to = "m1"),
- m1 = mkinsub("SFO"),
- use_of_ff = "max", quiet = TRUE)
+ m1 = mkinsub("SFO"),
+ use_of_ff = "max", quiet = TRUE)
SFO_SFO.ff.nosink <- mkinmod(
parent = mkinsub("SFO", "m1", sink = FALSE),
m1 = mkinsub("SFO"), quiet = TRUE, use_of_ff = "max")
FOMC_SFO <- mkinmod(parent = mkinsub("FOMC", to = "m1"),
m1 = mkinsub("SFO"), quiet = TRUE)
+DFOP_SFO <- mkinmod(parent = mkinsub("DFOP", to = "m1"),
+ m1 = mkinsub("SFO"),
+ use_of_ff = "max", quiet = TRUE)
# Avoid warning when fitting a dataset where zero value is removed
FOCUS_D <- subset(FOCUS_2006_D, value != 0)
diff --git a/tests/testthat/test_analytical.R b/tests/testthat/test_analytical.R
index 5972a18a..578258d3 100644
--- a/tests/testthat/test_analytical.R
+++ b/tests/testthat/test_analytical.R
@@ -1,6 +1,6 @@
context("Analytical solutions for coupled models")
-test_that("The analytical solutions of SFO-SFO are correct", {
+test_that("The analytical solutions for SFO-SFO are correct", {
# No sink, no formation fractions
SFO_SFO_nosink <- mkinmod(
parent = mkinsub("SFO", to = "m1", sink = FALSE),
@@ -44,3 +44,15 @@ test_that("The analytical solutions of SFO-SFO are correct", {
)
})
+
+test_that("The analytical solution for DFOP-SFO are correct", {
+ # With formation fraction
+ f_dfop_sfo_analytical <- mkinfit(DFOP_SFO, FOCUS_D,
+ solution_type = "analytical", quiet = TRUE)
+ f_dfop_sfo_desolve <- mkinfit(DFOP_SFO, FOCUS_D,
+ solution_type = "deSolve", quiet = TRUE)
+ expect_equal(
+ parms(f_dfop_sfo_analytical),
+ parms(f_dfop_sfo_desolve)
+ )
+})

Contact - Imprint