Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HYCAR-Hydro
airGR
Commits
605e6c2f
Commit
605e6c2f
authored
Jan 09, 2021
by
Dorchies David
Browse files
ci: error check on fake wrong ConvertFun for SeriesAggreg tests
Refs
#82
parent
192931c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/testthat/helper_seriesaggreg.R
deleted
100644 → 0
View file @
192931c7
sample2
<-
function
(
x
)
{
sample
(
x
,
2
)}
stringFunction
<-
function
(
x
)
{
format
(
max
(
x
))}
tests/testthat/test-SeriesAggreg.R
View file @
605e6c2f
...
...
@@ -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"
)
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment