Commit 605e6c2f authored by Dorchies David's avatar Dorchies David
Browse files

ci: error check on fake wrong ConvertFun for SeriesAggreg tests

Refs #82
parent 192931c7
sample2 <- function(x) {sample(x, 2)}
stringFunction <- function(x) {format(max(x))}
......@@ -230,11 +230,3 @@ test_that("SeriesAggreg should work with ConvertFun 'min', 'max' and 'median'",
}
lapply(c("max", "min", "median"), function(x) {test_ConvertFunRegime(Qls, x, "%Y")})
})
test_that("Error on wrong aggregation function", {
Qls <- BasinObs[, c("DatesR", "Qls")]
expect_error(SeriesAggreg(Qls, "%Y", ConvertFun = "sample2"),
regexp = "should be of length 1")
expect_error(SeriesAggreg(Qls, "%Y", ConvertFun = "stringFunction"),
regexp = "should be numeric")
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment