Skip to content

Commit

Permalink
added some missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
‘topepo’ committed Apr 10, 2024
1 parent 8866410 commit 810370b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/testthat/_snaps/grids.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
Error in `grid_regular()`:
! `levels` should have length 1 or 2

---

Code
grid_regular(mixture(), trees(), size = 3)
Condition
Warning:
`size` is not an argument to `grid_regular()`. Did you mean `levels`?
Error in `parameters()`:
! The objects should all be `param` objects.

# wrong argument name

Code
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test-grids.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ test_that("regular grid", {
),
2
)
expect_snapshot(
error = TRUE,
grid_regular(mixture(), trees(), size = 3)
)
expect_equal(
grid_regular(list(mixture(), trees()), levels = 3),
grid_regular(mixture(), trees(), levels = 3)
)
})

test_that("random grid", {
Expand Down

0 comments on commit 810370b

Please sign in to comment.