View source: R/expect-constant.R
expect_null | R Documentation |
NULL
?This is a special case because NULL
is a singleton so it's possible
check for it either with expect_equal(x, NULL)
or expect_type(x, "NULL")
.
expect_null(object, info = NULL, label = NULL)
object |
Object to test. Supports limited unquoting to make it easier to generate readable failures within a function or for loop. See quasi_label for more details. |
info |
Extra information to be included in the message. This argument is soft-deprecated and should not be used in new code. Instead see alternatives in quasi_label. |
label |
Used to customise failure messages. For expert use only. |
Other expectations:
comparison-expectations
,
equality-expectations
,
expect_error()
,
expect_length()
,
expect_match()
,
expect_named()
,
expect_output()
,
expect_reference()
,
expect_silent()
,
inheritance-expectations
,
logical-expectations
x <- NULL
y <- 10
expect_null(x)
show_failure(expect_null(y))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.