1
1
2
- # # Copyright (C) 2010 - 2024 Dirk Eddelbuettel and Romain Francois
2
+ # # Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois
3
3
# # Copyright (C) 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
4
4
# #
5
5
# # This file is part of Rcpp.
@@ -24,6 +24,8 @@ Rcpp::sourceCpp("cpp/sugar.cpp")
24
24
# # There are some (documented, see https://blog.r-project.org/2020/11/02/will-r-work-on-apple-silicon/index.html)
25
25
# # issues with NA propagation on arm64 / macOS. We not (yet ?) do anything special so we just skip some tests
26
26
isArmMacOs <- Sys.info()[[" sysname" ]] == " Darwin" && Sys.info()[[" machine" ]] == " arm64"
27
+ # # This also seems to hit arm64 on Linux
28
+ isArmLinux <- Sys.info()[[" sysname" ]] == " Linux" && Sys.info()[[" machine" ]] == " arm64"
27
29
28
30
# # Needed for a change in R 3.6.0 reducing a bias in very large samples
29
31
suppressWarnings(RNGversion(" 3.5.0" ))
@@ -66,15 +68,15 @@ expect_true( ! fx( 1:10 ) )
66
68
expect_true( fx( 6 : 10 ) )
67
69
expect_true( fx( 5 ) )
68
70
expect_true( ! fx( c(NA , 1 ) ) )
69
- if (! isArmMacOs ) expect_true( is.na( fx( c(NA , 6 ) ) ) )
71
+ if (! isArmMacOs && ! isArmLinux ) expect_true( is.na( fx( c(NA , 6 ) ) ) )
70
72
71
73
72
74
# test.sugar.all.one.equal <- function( ){
73
75
fx <- runit_all_one_equal
74
76
expect_true( ! fx( 1 ) )
75
77
expect_true( ! fx( 1 : 2 ) )
76
78
expect_true( fx( rep(5 ,4 ) ) )
77
- if (! isArmMacOs ) expect_true( is.na( fx( c(5 ,NA ) ) ) )
79
+ if (! isArmMacOs && ! isArmLinux ) expect_true( is.na( fx( c(5 ,NA ) ) ) )
78
80
expect_true(! fx( c(NA , 1 ) ) )
79
81
80
82
@@ -83,7 +85,7 @@ fx <- runit_all_not_equal_one
83
85
expect_true( fx( 1 ) )
84
86
expect_true( fx( 1 : 2 ) )
85
87
expect_true( ! fx( 5 ) )
86
- if (! isArmMacOs ) expect_true( is.na( fx( c(NA , 1 ) ) ) )
88
+ if (! isArmMacOs && ! isArmLinux ) expect_true( is.na( fx( c(NA , 1 ) ) ) )
87
89
expect_true( ! fx( c(NA , 5 ) ) )
88
90
89
91
@@ -1620,7 +1622,7 @@ expect_error(strimws(x[1], "invalid"), info = "strimws -- bad `which` argument")
1620
1622
# # min/max
1621
1623
# test.sugar.min.max <- function() {
1622
1624
# # min(empty) gives NA for integer, Inf for numeric (#844)
1623
- if (! isArmMacOs ) expect_true(is.na(intmin(integer(0 ))), " min(integer(0))" )
1625
+ if (! isArmMacOs && ! isArmLinux ) expect_true(is.na(intmin(integer(0 ))), " min(integer(0))" )
1624
1626
if (! isArmMacOs ) expect_equal(doublemin(numeric (0 )), Inf , info = " min(numeric(0))" )
1625
1627
1626
1628
# # max(empty_ gives NA for integer, Inf for numeric (#844)
0 commit comments