diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2017-06-17 16:36:13 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2017-06-17 16:36:13 +0200 |
commit | c9bcd8e68db61515080ff377c6a04fa807337258 (patch) | |
tree | 4ff0e1226951c4ff76824883888a290b1d81f99a /tests | |
parent | e6f968cf97ed6ca9268e6098d86ba63ff2c6d2b0 (diff) |
Start with the generation of an input file
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testthat/test_step_1.R | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/testthat/test_step_1.R b/tests/testthat/test_step_1.R index 2be5df8..0c8710b 100644 --- a/tests/testthat/test_step_1.R +++ b/tests/testthat/test_step_1.R @@ -1,10 +1,20 @@ context("FOCUS Step 1 calculations") t_out <- c(0, 1, 2, 4) # Checking the first four days is sufficient for Step 1 +test_txt <- readLines( + system.file("testdata/Steps_12_pesticide.txt", package = "pfm") +) test_that("Results of Steps 1/2 calculator for Dummy 1 are reproduced", { - dummy_1 <- chent_focus_sw(cwsat = 6000, DT50_ws = 6, Koc = 344.8) - res_dummy_1 <- PEC_sw_focus(dummy_1, 3000, f_drift = 0) + dummy_1 <- chent_focus_sw("Dummy 1", cwsat = 6000, DT50_ws = 6, Koc = 344.8) + res_dummy_1 <- PEC_sw_focus(dummy_1, 3000, + comment = "Potatoes, Southern Europe, spring, 1 app/season, soil incorporation", + f_drift = 0, + append = FALSE, overwrite = TRUE) + + pest_txt <- readLines("pesticide.txt") + expect_equal(test_txt[1], pest_txt[1]) + strsplit(test_txt[2], "\t")[[1]] PEC_orig_1 = matrix(NA, nrow = length(t_out), ncol = 4, dimnames = list(Time = t_out, type = c("PECsw", "TWAECsw", "PECsed", "TWAECsed"))) @@ -112,3 +122,4 @@ test_that("Results of Steps 1/2 calculator for New Dummy (M1-M3) are reproduced" expect_equal(res_M2$PEC[1:4, ], PEC_orig_M2[, ], tolerance = 0.01, scale = 1) }) +unlink("pesticide.txt") |