aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testthat')
-rw-r--r--tests/testthat/FOCUS_2006_D.csf14
-rw-r--r--tests/testthat/FOCUS_2006_D.rdsbin591 -> 561 bytes
-rw-r--r--tests/testthat/test_CAKE_export.R13
3 files changed, 18 insertions, 9 deletions
diff --git a/tests/testthat/FOCUS_2006_D.csf b/tests/testthat/FOCUS_2006_D.csf
index 5969712b..180091ab 100644
--- a/tests/testthat/FOCUS_2006_D.csf
+++ b/tests/testthat/FOCUS_2006_D.csf
@@ -1,11 +1,11 @@
[FileInfo]
-CAKE-Version: 3.3 (Release)
+CAKE-Version: 3.4 (Release)
Name: FOCUS 2006 D
Description:
MeasurementUnits: % AR
TimeUnits: days
-Comments: Created using mkin::CAKE_export
-Date: Dummy date 0000-00-00
+Comments:
+Date: 1900-01-01
Optimiser: IRLS
[Data]
@@ -22,7 +22,7 @@ Time Parent
119 0.6
NewDataSet: FOCUS D
-Time Parent M1
+Time Parent A1
0 99.46 0
0 102.04 0
1 93.5 4.84
@@ -49,9 +49,9 @@ Time Parent M1
[Model]
ParentCompartment: Parent parent parent
-Compartment: M1 m1 m1
-Link: Parent M1 0.5 0 1 Free Explicit
+Compartment: A1 m1 m1
+Link: Parent A1 0.5 0 1 Free Explicit
[ComponentNames]
Parent:parent
-M1:m1
+A1:m1
diff --git a/tests/testthat/FOCUS_2006_D.rds b/tests/testthat/FOCUS_2006_D.rds
index ff3b4f0f..3df805c8 100644
--- a/tests/testthat/FOCUS_2006_D.rds
+++ b/tests/testthat/FOCUS_2006_D.rds
Binary files differ
diff --git a/tests/testthat/test_CAKE_export.R b/tests/testthat/test_CAKE_export.R
index b3941f1b..abedc9eb 100644
--- a/tests/testthat/test_CAKE_export.R
+++ b/tests/testthat/test_CAKE_export.R
@@ -1,13 +1,22 @@
context("Export dataset for reading into CAKE")
test_that("Exporting is reproducible", {
- CAKE_export(
+ expect_error(CAKE_export(
ds = list("FOCUS C" = FOCUS_2006_C,
"FOCUS D" = FOCUS_2006_D),
map = c(parent = "Parent", m1 = "M1"),
links = c(parent = "m1"),
filename = "FOCUS_2006_D.csf", overwrite = TRUE,
- study = "FOCUS 2006 D", date = "Dummy date 0000-00-00")
+ study = "FOCUS 2006 D", date = "1900-01-01"),
+ "elements of map have to be CAKE compartment names"
+ )
+ CAKE_export(
+ ds = list("FOCUS C" = FOCUS_2006_C,
+ "FOCUS D" = FOCUS_2006_D),
+ map = c(parent = "Parent", m1 = "A1"),
+ links = c(parent = "m1"),
+ filename = "FOCUS_2006_D.csf", overwrite = TRUE,
+ study = "FOCUS 2006 D", date = "1900-01-01")
csf <- readLines(con = "FOCUS_2006_D.csf")
expect_known_value(csf, file = "FOCUS_2006_D.rds")
expect_error(CAKE_export(ds = list("FOCUS C" = FOCUS_2006_C),

Contact - Imprint