Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SISIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFCB
SISIR
Commits
abf93578
Commit
abf93578
authored
2 years ago
by
Nathalie Vialaneix
Browse files
Options
Downloads
Patches
Plain Diff
added tests on inputs for SFCB function
parent
629d1e85
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/testthat/test_sfcb.R
+28
-0
28 additions, 0 deletions
tests/testthat/test_sfcb.R
with
28 additions
and
0 deletions
tests/testthat/test_sfcb.R
+
28
−
0
View file @
abf93578
...
...
@@ -91,3 +91,31 @@ test_that("`sfcb` works for one `at` with selection.", {
range.at
=
c
(
5
,
12
))
expect_named
(
out14
,
expected_outputs
)
})
test_that
(
"`sfcb` properly returns error when expected."
,
{
expect_error
({
sfcb
(
rainfall
,
truffles
,
at
=
"1"
)},
"'at' must be a positive integer"
,
fixed
=
FALSE
)
expect_error
({
sfcb
(
rainfall
,
truffles
,
at
=
-3
)},
"'at' must be a positive integer"
,
fixed
=
FALSE
)
expect_error
({
sfcb
(
rainfall
,
truffles
,
at
=
2.4
)},
"'at' must be a positive integer"
,
fixed
=
FALSE
)
expect_error
({
sfcb
(
rainfall
,
truffles
,
range.at
=
1
:
3
)},
"'range.at' must be a vector of minimum and maximum numbers"
,
fixed
=
FALSE
)
expect_error
({
sfcb
(
rainfall
,
truffles
,
range.at
=
c
(
"1"
,
"2"
))},
"'range.at' must be a vector of minimum and maximum numbers"
,
fixed
=
FALSE
)
expect_error
({
sfcb
(
rainfall
,
truffles
,
range.at
=
c
(
-1
,
2
))},
"'range.at' must be a vector of minimum and maximum numbers"
,
fixed
=
FALSE
)
expect_error
({
sfcb
(
rainfall
,
truffles
,
range.at
=
c
(
1.4
,
2
))},
"'range.at' must be a vector of minimum and maximum numbers"
,
fixed
=
FALSE
)
expect_error
({
sfcb
(
rainfall
,
truffles
,
range.at
=
c
(
5
,
2
))},
"'range.at' must be a vector of minimum and maximum numbers"
,
fixed
=
FALSE
)
expect_error
({
sfcb
(
rainfall
,
truffles
,
seed
=
"1"
)},
"'seed' must be numeric!"
,
fixed
=
FALSE
)
})
This diff is collapsed.
Click to expand it.
Nathalie Vialaneix
@nathalie.villa-vialaneix
mentioned in issue
#2 (closed)
·
2 years ago
mentioned in issue
#2 (closed)
mentioned in issue #2
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment