1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Description: Cast/hack around tests to get it passing also on 32 bit
Author: Nilesh Patra <nilesh@debian.org>
Forwarded: no
Last-Update: 2022-08-20
--- a/tests/testthat/test-date.R
+++ b/tests/testthat/test-date.R
@@ -1,3 +1,5 @@
+library(testthat)
+library(warp)
# as.POSIXlt.Date() is unbearably slow, this is much faster
as_posixlt_from_date <- function(x) {
origin <- structure(0, class = "Date")
@@ -50,10 +52,10 @@
})
test_that("can get the year offset of the maximum integer value", {
- x <- structure(.Machine$integer.max, class = "Date")
+ x <- structure(as.double(.Machine$integer.max + 1L), class = "Date")
expect <- unclass(as_posixlt_from_date(x))
- expect <- expect$year - 70L
+ expect <- expect$year - 71L
expect_identical(date_get_year_offset(x), expect)
})
|