The building block of all
expect() when writing your own expectations. See
vignette("custom-expectation") for details.
expect( ok, failure_message, info = NULL, srcref = NULL, trace = NULL, trace_env = caller_env() )
FALSEindicating if the expectation was successful.
Message to show if the expectation failed.
Character vector continuing additional information. Included for backward compatibility only and new expectations should not use it.
Location of the failure. Should only needed to be explicitly supplied when you need to forward a srcref captured elsewhere.
An optional backtrace created by
rlang::trace_back(). When supplied, the expectation is displayed with the backtrace.
is.null(trace), this is used to automatically generate a traceback running from
trace_env. You'll generally only need to set this if you're wrapping an expectation inside another function.
expect() creates and signals an expectation in one go,
exp_signal() separately signals an expectation that you
have manually created with
new_expectation(). Expectations are
signalled with the following protocol: