gives_warning {testthat} | R Documentation |
Needs to match at least one of the warnings produced by the expression.
gives_warning(regexp = NULL) expect_warning(object, regexp = NULL, info = NULL, label = NULL)
regexp |
optional regular expression to match. If not specified, just asserts that expression gives some warning. |
object |
object to test |
info |
extra information to be included in the message (useful when writing tests in loops). |
label |
object label. When |
Other expectations: equals
,
expect_equal
,
expect_equivalent
,
expect_error
, expect_false
,
expect_identical
, expect_is
,
expect_match
, expect_message
,
expect_output
, expect_true
,
is_a
, is_equivalent_to
,
is_false
, is_identical_to
,
is_true
, matches
,
prints_text
, shows_message
,
takes_less_than
, throws_error
expect_that(warning("a"), gives_warning()) expect_that(warning("a"), gives_warning("a"))