Skip to content

Commit

Permalink
improve error testing of project_to_curve()
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Jan 18, 2021
1 parent 7fc080f commit 3b1e076
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/testthat/test-project_to_curve.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,14 @@ test_that("Values are more or less correct, without stretch", {


test_that("Expect project_to_curve to error elegantly", {
# expect_error(project_to_curve(list(1), list(1)))
# expect_error(project_to_curve(x = list(), s = s, stretch = 0))
# expect_error(project_to_curve(x = x, s = list(), stretch = 0))
expect_error(project_to_curve(list(1), list(1)))
expect_error(project_to_curve(x = list(), s = s, stretch = 0))
expect_error(project_to_curve(x = x, s = list(), stretch = 0))
expect_error(project_to_curve(x, s, stretch = -1), "larger than or equal to 0")
# expect_error(project_to_curve(x, s, stretch = "10"))
expect_error(project_to_curve(x, s, stretch = "10"))
expect_error(project_to_curve(x, cbind(s, s)), "must have an equal number of columns")
expect_error(project_to_curve(x, s[1,,drop=FALSE]), "at least two rows")
expect_error(project_to_curve(x[integer(0),,drop=FALSE], s), "at least one row")
})


Expand Down

0 comments on commit 3b1e076

Please sign in to comment.