# Intended for package testing only.
all.equal.compare <- function(target, current, tolerance = 1e-3, ...){
  Y <- all.equal(target = target[["Y"]],
                 current = current[["Y"]],
                 tolerance = tolerance, ...)
  empirical_stats <- all.equal(target = target[["empirical_stats"]],
                              current = current[["empirical_stats"]],
                              tolerance = tolerance, ...)
  theoretical_stats <- all.equal(target = target[["theoretical_stats"]],
                           current = current[["theoretical_stats"]],
                           tolerance = tolerance, ...)
  p <- all.equal(target = target[["p"]],
                 current = current[["p"]],
                 tolerance = tolerance, ...)
  
  return(all(isTRUE(Y), isTRUE(empirical_stats), isTRUE(theoretical_stats), isTRUE(p)))
}
