aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRanke Johannes <johannes.ranke@agroscope.admin.ch>2024-03-06 15:37:10 +0100
committerRanke Johannes <johannes.ranke@agroscope.admin.ch>2024-03-06 15:37:10 +0100
commitf20ed2fd0d9629975b8a170ecdfed531ac9c906b (patch)
tree57b540cee3bdfc658a33e564a2d5900f1f3684d0 /tests
parenta50b002ef4fa5708f1d82287d70b0c4e9c768f9c (diff)
Update tests for PEC_sw_drift
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/test_PEC_sw_drift.R9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/testthat/test_PEC_sw_drift.R b/tests/testthat/test_PEC_sw_drift.R
index 667b402..a0972eb 100644
--- a/tests/testthat/test_PEC_sw_drift.R
+++ b/tests/testthat/test_PEC_sw_drift.R
@@ -13,7 +13,7 @@ test_that("PEC_sw_drift gives the same results as the CRD PEC calculator", {
# 4 applications of 30 g/ha to late fruit crops calculated with UK PEC
# calculator published by CRD. CRD uses different drift values from SANCO aquatic
# guidance), except for 50 m
- pfm_30_4_obst_spaet <- round(PEC_sw_drift(30, 4, crop = "Obstbau spaet",
+ pfm_30_4_obst_spaet <- round(PEC_sw_drift(30, 4, crop_group_JKI = "Obstbau spaet",
distances = c(3, 20, 50)), 3)
crd_30_4_obst_spaet <- c('3 m' = 1.101, '20 m' = 0.080, '50 m' = 0.013)
expect_equal(pfm_30_4_obst_spaet[3], crd_30_4_obst_spaet[3])
@@ -24,7 +24,8 @@ test_that("The Rautmann formula is correctly implemented", {
pfm_rf <- PEC_sw_drift(100, drift_data = "RF")
expect_equal(pfm_jki, pfm_rf, tolerance = 0.01)
- expect_error(PEC_sw_drift(100, drift_data = "RF", applications = 2), "Rautmann formula not included")
- expect_error(PEC_sw_drift(100, drift_data = "RF", applications = 1, crop = "Obstbau spaet"),
- "Rautmann formula not included")
+ expect_error(PEC_sw_drift(100, drift_data = "RF", applications = 10), "Only 1 to 8 applications")
+ expect_error(PEC_sw_drift(100, drift_data = "RF", applications = 1, crop_group_focus = "Obstbau spaet"),
+ "should be one of")
+ expect_silent(PEC_sw_drift(100, drift_data = "RF", applications = 1, crop_group_focus = "fruit, late"))
})

Contact - Imprint