Open lentinj opened 3 months ago
For this to work we'd need some kind of ut_cmp_eq() to pass through to, e.g:
ut_cmp_eq <- function(a, b) unittest:::cmp_inner(
a, b,
comparison_fn = function(a, b) all(a == b),
filter = function (x) writeLines(paste0("[", seq_along(x), "]", format(x))),
context_lines = 1e8)
ut_cmp_eq(1:5, c(1, 4, 2, 9, 444))
ut_cmp_eq(1:5, c(1:3, 99, 5))
The formatting here is okay, but not sure it'd survive more complex objects.
When the unevaluated call to ok is to
==
(or another known function), redirect it to aut_cmp_eq()
that can:all(x == y)
(possibly this is somethingok()
should be doing anyway, and acceptingall(isTRUE(result))
as success)==
on it's own, in the appropriate environment