The building block of all expect_ functions
Call 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() )
ok |
|
failure_message |
Message to show if the expectation failed. |
info |
Character vector continuing additional information. Included for backward compatibility only and new expectations should not use it. |
srcref |
Location of the failure. Should only needed to be explicitly supplied when you need to forward a srcref captured elsewhere. |
trace |
An optional backtrace created by |
trace_env |
If |
While 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:
If the expectation is a failure or an error, it is signalled with
base::stop()
. Otherwise, it is signalled with
base::signalCondition()
.
The continue_test
restart is registered. When invoked, failing
expectations are ignored and normal control flow is resumed to
run the other tests.
An expectation object. Signals the expectation condition
with a continue_test
restart.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.