evaluate_promise: Evaluate a promise, capturing all types of output.
Description
This uses evaluate a promise, returning the
result, test, messages and warnings that the code creates in a list.
It is used to evaluate code for all test that tests, ensuring that
(as much as possible) any spurious output is suppressed during the
testing process.
Usage
evaluate_promise(code, print = FALSE)
Arguments
code
Code to evaluate. This should be an unevaluated expression.
print
If TRUE and the result of evaluating code is
visible this will print the result, ensuring that the output of printing
the object is included in the overall output
Value
A list containing
resultThe result of the function
outputA string containing all the output from the function
warningsA character vector containing the text from each warning
messagesA character vector containing the text from each message