Skip to content

Commit c79fe5d

Browse files
committed
Test if previous mean results can be reproduced
1 parent 971ce6f commit c79fe5d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/testthat/test-function-run_rabimo.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#library(testthat)
22

3+
test_that("run_rabimo() reproduces previous results", {
4+
config <- kwb.rabimo::rabimo_inputs_2020$config
5+
data <- kwb.rabimo::rabimo_inputs_2020$data
6+
results <- kwb.rabimo::run_rabimo(data, config)
7+
result <- colMeans(results[, c("runoff", "infiltr", "evapor")])
8+
expected_result <- c(runoff = 162.5073, infiltr = 184.4515, evapor = 284.8178)
9+
expect_equal(round(result, 4L), expected_result)
10+
})
11+
312
test_that("run_rabimo() works", {
413

514
f <- kwb.rabimo::run_rabimo
@@ -67,4 +76,6 @@ test_that("run_rabimo() works", {
6776
expect_s3_class(result, "data.frame")
6877
expect_true(nrow(result) == nrow(data))
6978

79+
80+
7081
})

0 commit comments

Comments
 (0)