Skip to content

Commit 565eb14

Browse files
committed
Enable tolerance
1 parent 8b6bf16 commit 565eb14

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

R/expect-all.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ expect_all_equal_ <- function(act, exp, trace_env = caller_env()) {
6262
"Expected every element of %s to equal %s.",
6363
act,
6464
exp,
65+
tolerance = testthat_tolerance(),
6566
trace_env = trace_env
6667
)
6768
}

tests/testthat/test-expect-all.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ test_that("can compare named lists", {
2020
expect_snapshot_failure(expect_all_equal(x, list(1)))
2121
})
2222

23+
test_that("has tolerance enabled", {
24+
expect_success(expect_all_equal(1, 1L))
25+
})
26+
2327
test_that("truncates very long differences", {
2428
x <- rep(TRUE, 10)
2529
expect_snapshot_failure(expect_all_equal(x, FALSE))

0 commit comments

Comments
 (0)