aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_CAKE_export.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-03-19 05:51:10 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2022-03-19 05:51:10 +0100
commitd03a6abad27d6eef13dceb64f31b1278bb816c00 (patch)
treeedb0d2ae49ce3e74167616305bab494ba7670fc1 /tests/testthat/test_CAKE_export.R
parente48c1f2ef990a622722e416c8d301430db4f5081 (diff)
Improvements to CAKE_export()
Diffstat (limited to 'tests/testthat/test_CAKE_export.R')
-rw-r--r--tests/testthat/test_CAKE_export.R13
1 files changed, 11 insertions, 2 deletions
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