Compare the result produced by an edited replay project with the original
result captured by unpack_call(). The comparison distinguishes exact
identity, equality within all.equal() tolerance, structural differences,
and values that are not meaningfully comparable.
Arguments
- custom_result
The result produced by the customized replay call.
- original_result
The original result captured by
unpack_call().- ignore
Character vector of top-level list element names to remove from both results before comparison, when both results are lists.
- tolerance
Relative-difference tolerance used both by the overall
all.equal()comparison and by the per-element numeric-difference summary, so a customization that only introduces floating-point noise (different BLAS, different summation order, ...) is not counted the same as one that meaningfully changes the result. Defaults tosqrt(.Machine$double.eps), matchingall.equal.numeric()'s default.
Examples
compare_call(c(1, 2), c(1, 2))
#>
#> ── insideR comparison ──────────────────────────────────────────────────────────
#> Status: identical
#> custom_result and original_result are identical.
#>
#> ── Details ──
#>
#> • No differences detected by identical().
compare_call(
list(value = 1, date = Sys.time()),
list(value = 1, date = Sys.time() + 1),
ignore = "date"
)
#>
#> ── insideR comparison ──────────────────────────────────────────────────────────
#> Status: identical
#> custom_result and original_result are identical.
#> Ignored top-level field: date
#>
#> ── Details ──
#>
#> • No differences detected by identical().