Simply checks if an argument is TRUE.
Arguments
- x
[
any]
Object to check.- na.ok
[
logical(1)]
Are missing values allowed? Default isFALSE.- .var.name
[
character(1)]
Name of the checked object to print in assertions. Defaults to the heuristic implemented invname.- add
[
AssertCollection]
Collection to store assertion messages. SeeAssertCollection.
Value
Depending on the function prefix:
If the check is successful, the functions
assertTRUE./assert_true. return
x invisibly, whereas
checkTRUE./check_true. and
testTRUE./test_true. return
TRUE.
If the check is not successful,
assertTRUE./assert_true.
throws an error message,
testTRUE./test_true.
returns FALSE,
and checkTRUE./check_true.
return a string with the error message.
The function expect_true. always returns an
expectation.