testwhat (version 4.2.2)

check_that: Expectation wrapper

Description

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

Usage

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

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

Run this code
## Not run: 
# check_that(is_true(3 == 3))
# check_that(is_false(3 == 4))
# check_that(is_gte(4, 3))
# check_that(is_equal(4, 4))
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace