Skip to content

Commit

Permalink
tests: Add second tests for stopifnot
Browse files Browse the repository at this point in the history
  • Loading branch information
MEO265 committed Jan 10, 2024
1 parent 59bc12f commit efb9c13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/testthat/test-handlers.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ test_that("stopifnot",{
expect_identical_error(stopifnot(f(x = FALSE)), base::stopifnot(f(x = FALSE)))
g <- function () f(FALSE)
expect_identical_error(stopifnot(4 == 4, g()), base::stopifnot(4==4, g()))
expect_identical_error(stopifnot(4 == 4, "Test" = g()), base::stopifnot(4==4, "Test" = g()))
expect_identical_error(stopifnot(exprs = {TRUE; FALSE}), base::stopifnot(exprs = {TRUE; FALSE}))
expect_identical_error(stopifnot(exprObject = {TRUE; FALSE}), base::stopifnot(exprObject = {TRUE; FALSE}))
expect_no_error(stopifnot(TRUE, 3 == 3))
})

Expand Down

0 comments on commit efb9c13

Please sign in to comment.