-
Notifications
You must be signed in to change notification settings - Fork 341
Closed
Description
I would expect that this should work:
library(testthat)
expect_lte(Sys.time()- 1E5, Sys.time())
#> Error in expect_compare("<=", act, exp): is.numeric(act$val) is not TRUEInstead I have to resort to this:
library(testthat)
expect_true(Sys.time()- 1E5 <= Sys.time())Possibly one could add inherits(Sys.time(), "POSIXct") to
testthat/R/expect-comparison.R
Lines 27 to 28 in ef9c814
| stopifnot(is.numeric(act$val), length(act$val) == 1) | |
| stopifnot(is.numeric(exp$val), length(exp$val) == 1) |
Am I understanding usage properly here? It could be that these were never meant to be used with dates and times.
Metadata
Metadata
Assignees
Labels
No labels