Skip to content

Commit

Permalink
Make pause test failure more informative (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored Sep 16, 2024
1 parent 8c72449 commit e548519
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/testthat/test-pause.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
test_that("pause takes expected time", {
time <- system.time(pause(0.2))[[3]]
# system.time is a little inaccurate so allow 10% padding
expect_true(abs(time - 0.2) < 1e-2)
expect_lt(abs(time - 0.2) / 0.2, 0.1)
})

test_that("works with integers", {
Expand Down

0 comments on commit e548519

Please sign in to comment.