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().
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.