diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2022-03-19 05:51:10 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2022-03-19 05:51:10 +0100 |
commit | d03a6abad27d6eef13dceb64f31b1278bb816c00 (patch) | |
tree | edb0d2ae49ce3e74167616305bab494ba7670fc1 /tests/testthat | |
parent | e48c1f2ef990a622722e416c8d301430db4f5081 (diff) |
Improvements to CAKE_export()
Diffstat (limited to 'tests/testthat')
-rw-r--r-- | tests/testthat/FOCUS_2006_D.csf | 14 | ||||
-rw-r--r-- | tests/testthat/FOCUS_2006_D.rds | bin | 591 -> 561 bytes | |||
-rw-r--r-- | tests/testthat/test_CAKE_export.R | 13 |
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 Binary files differindex ff3b4f0f..3df805c8 100644 --- a/tests/testthat/FOCUS_2006_D.rds +++ b/tests/testthat/FOCUS_2006_D.rds 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), |