File: skip_two_tests_for_32bit.patch

package info (click to toggle)
r-cran-checkmate 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,504 kB
  • sloc: ansic: 2,196; sh: 9; makefile: 8
file content (26 lines) | stat: -rw-r--r-- 1,034 bytes parent folder | download
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
26
Description: Exclude tests on 32bit architectures
Bug-Debian: https://bugs.debian.org/1041556
Author: Andreas Tille <tille@debian.org>
Origin: https://lists.debian.org/debian-r/2023/08/msg00010.html
Last-Update: Wed, 16 Aug 2023 08:41:10 +0200
Comment: Alternatives for this solution:
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1041556#49
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1041556#54

--- a/tests/testthat/test_checkIntegerish.R
+++ b/tests/testthat/test_checkIntegerish.R
@@ -68,8 +68,14 @@ test_that("sorted works", {
   expect_true(grepl("sorted", checkIntegerish(3:1, sorted = TRUE), fixed = TRUE))
 })
 
+# Define a function that checks if the architecture is 32-bit
+is_32bit_arch <- function() {
+  .Machine$sizeof.pointer == 4
+}
+
 test_that("informative error messages", {
   x = checkIntegerish((.Machine$integer.max + as.double(-3:3)))
+  skip_if(is_32bit_arch(), "Skipping test on 32-bit architectures")
   expect_string(x, fixed = "element 5")
   expect_string(x, fixed = "integer range")