makeTest {checkmate} | R Documentation |
Turn a Check into a Test
Description
makeTest
is the internal function used to evaluate the result of a
check and throw an exception if necessary.
This function is currently only a stub and just calls isTRUE
.
makeTestFunction
can be used to automatically create an assertion
function based on a check function (see example).
Usage
makeTest(res)
makeTestFunction(check.fun, c.fun = NULL, env = parent.frame())
Arguments
res |
[ |
check.fun |
[ |
c.fun |
[ |
env |
[ |
Value
makeTest
returns TRUE
if the check is successful and FALSE
otherwise.
makeTestFunction
returns a function
.
See Also
Other CustomConstructors:
makeAssertion()
,
makeExpectation()
Examples
# Simple custom check function
checkFalse = function(x) if (!identical(x, FALSE)) "Must be FALSE" else TRUE
# Create the respective test function
testFalse = function(x) {
res = checkFalse(x)
makeTest(res)
}
# Alternative: Automatically create such a function
testFalse = makeTestFunction(checkFalse)
print(testFalse)