Evaluate or compare an expression based on a reference expression, or test for errors.
The comparison of expression values is done using base::all.equal().
Whether the test condition has passed successfully. In case of onFail = "skip", NA is returned.
Details
Inspired by the data.table package test mechanism.
The original motivation for this function is the lack of R support for a proper stack trace with line numbers when sourcing files,
which made it practically impossible to identify the offending line in a sourced file.