This function wraps around an is_... function. When the expectation fails to be met, the feedback message is sent to the reporter. You can use is_true, is_false, is_gte or is_equal

check_that(code, feedback, env = parent.frame())

test_what(code, feedback)

Arguments

code

The expectation that should be wrapped

feedback

A character string with feedback when the expection is not met OR a list object, containing multiple pieces of information. This list should at least contain an element named message

env

environment in which the test should be evaluated; defaults to parent.frame()

Examples

if (FALSE) { check_that(is_true(3 == 3)) check_that(is_false(3 == 4)) check_that(is_gte(4, 3)) check_that(is_equal(4, 4)) }