File: fix-32-bit.patch

package info (click to toggle)
r-cran-warp 0.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 536 kB
  • sloc: ansic: 2,883; sh: 13; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 798 bytes parent folder | download | duplicates (2)
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)
 })