Aliases: makeAssertion makeAssertionFunction
Keywords:
### ** Examples # Simple custom check function checkFalse = function(x) if (!identical(x, FALSE)) "Must be FALSE" else TRUE # Create the respective assert function assertFalse = function(x, .var.name = vname(x), add = NULL) { res = checkFalse(x) makeAssertion(x, res, .var.name, add) } # Alternative: Automatically create such a function assertFalse = makeAssertionFunction(checkFalse) print(assertFalse)
function (x, .var.name = checkmate::vname(x), add = NULL) { if (missing(x)) stop(sprintf("argument \"%s\" is missing, with no default", .var.name)) res = checkFalse(x) checkmate::makeAssertion(x, res, .var.name, add) } <environment: 0x55ccff805038>