|
1 | 1 |
|
2 | 2 | isSolaris <- Sys.info()[["sysname"]] == "SunOS"
|
3 | 3 | isWindows <- Sys.info()[["sysname"]] == "Windows"
|
| 4 | +isMacOS <- Sys.info()[["sysname"]] == "Darwin" # not needed for winbuilder or r-univere but M1mac |
4 | 5 | isFedora <- anytime:::.isFedora()
|
| 6 | +isWinOrMac <- isWindows || isMacOS |
5 | 7 |
|
6 | 8 | ## We turn off tests on Solaris with some regret, yet firmly, as the
|
7 | 9 | ## combined inability of CRAN to provide us a test platform (to
|
@@ -47,45 +49,45 @@ if (isStupid) exit_file("Skipping Stupid (2 of 2)")
|
47 | 49 |
|
48 | 50 | ## Dates: Integer
|
49 | 51 | expect_equivalent(refD, anydate(20160101L + 0:2))
|
50 |
| -if (!isWindows) expect_equal(refT, anytime(20160101L + 0:2, oldHeuristic=TRUE), check.tzone=FALSE) |
| 52 | +if (!isWinOrMac) expect_equal(refT, anytime(20160101L + 0:2, oldHeuristic=TRUE), check.tzone=FALSE) |
51 | 53 |
|
52 | 54 | ## Dates: Numeric
|
53 | 55 | expect_equivalent(refD, anydate(20160101 + 0:2))
|
54 |
| -if (!isWindows) expect_equal(refT, anytime(20160101 + 0:2, oldHeuristic=TRUE), check.tzone=FALSE) |
| 56 | +if (!isWinOrMac) expect_equal(refT, anytime(20160101 + 0:2, oldHeuristic=TRUE), check.tzone=FALSE) |
55 | 57 |
|
56 | 58 | ## Dates: Factor
|
57 | 59 | expect_equivalent(refD, anydate(as.factor(20160101 + 0:2)))
|
58 |
| -if (!isWindows) expect_equal(refT, anytime(as.factor(20160101 + 0:2)), check.tzone=FALSE) |
| 60 | +if (!isWinOrMac) expect_equal(refT, anytime(as.factor(20160101 + 0:2)), check.tzone=FALSE) |
59 | 61 |
|
60 | 62 | ## Dates: Ordered
|
61 | 63 | expect_equivalent(refD, anydate(as.ordered(20160101 + 0:2)))
|
62 |
| -if (!isWindows) expect_equal(refT, anytime(as.ordered(20160101 + 0:2)), check.tzone=FALSE) |
| 64 | +if (!isWinOrMac) expect_equal(refT, anytime(as.ordered(20160101 + 0:2)), check.tzone=FALSE) |
63 | 65 |
|
64 | 66 | ## Dates: Character
|
65 | 67 | expect_equivalent(refD, anydate(as.character(20160101 + 0:2)))
|
66 |
| -if (!isWindows) expect_equal(refT, anytime(as.character(20160101 + 0:2)), check.tzone=FALSE) |
| 68 | +if (!isWinOrMac) expect_equal(refT, anytime(as.character(20160101 + 0:2)), check.tzone=FALSE) |
67 | 69 |
|
68 | 70 | ## Dates: alternate formats
|
69 | 71 | expect_equivalent(refD, anydate(c("20160101", "2016/01/02", "2016-01-03")))
|
70 |
| -if (!isWindows) expect_equal(refT, anytime(c("20160101", "2016/01/02", "2016-01-03")), check.tzone=FALSE) |
| 72 | +if (!isWinOrMac) expect_equal(refT, anytime(c("20160101", "2016/01/02", "2016-01-03")), check.tzone=FALSE) |
71 | 73 |
|
72 | 74 | ## Datetime: ISO with/without fractional seconds
|
73 | 75 | refPt <- as.POSIXct(as.POSIXlt(c("2016-01-01 10:11:12", "2016-01-01 10:11:12.345678")))
|
74 |
| -if (!isWindows) expect_equal(refPt, anytime(c("2016-01-01 10:11:12", "2016-01-01 10:11:12.345678")), check.tzone=FALSE) |
| 76 | +if (!isWinOrMac) expect_equal(refPt, anytime(c("2016-01-01 10:11:12", "2016-01-01 10:11:12.345678")), check.tzone=FALSE) |
75 | 77 |
|
76 | 78 | ## Datetime: ISO alternate (?) with 'T' separator
|
77 | 79 | ## Only works with ' '
|
78 |
| -if (!isWindows) expect_equal(refPt, anytime(c("20160101 101112", "20160101 101112.345678")), check.tzone=FALSE) |
| 80 | +if (!isWinOrMac) expect_equal(refPt, anytime(c("20160101 101112", "20160101 101112.345678")), check.tzone=FALSE) |
79 | 81 |
|
80 | 82 | ## Datetime: textual month formats
|
81 | 83 | ref3 <- rep(as.POSIXct(as.POSIXlt("2016-09-01 10:11:12")), 3)
|
82 |
| -if (!isWindows) expect_equal(ref3, |
83 |
| - anytime(c("2016-Sep-01 10:11:12", "Sep/01/2016 10:11:12", |
84 |
| - "Sep-01-2016 10:11:12")), check.tzone=FALSE) |
| 84 | +if (!isWinOrMac) expect_equal(ref3, |
| 85 | + anytime(c("2016-Sep-01 10:11:12", "Sep/01/2016 10:11:12", |
| 86 | + "Sep-01-2016 10:11:12")), check.tzone=FALSE) |
85 | 87 |
|
86 | 88 | ## Datetime: Mixed format (cf http://stackoverflow.com/questions/39259184)
|
87 |
| -if (!isWindows) expect_equal(refPt, |
88 |
| - anytime(c("Thu Jan 01 10:11:12 2016", "Thu Jan 01 10:11:12.345678 2016")), check.tzone=FALSE) |
| 89 | +if (!isWinOrMac) expect_equal(refPt, |
| 90 | + anytime(c("Thu Jan 01 10:11:12 2016", "Thu Jan 01 10:11:12.345678 2016")), check.tzone=FALSE) |
89 | 91 |
|
90 | 92 | ## Datetime: pre/post DST
|
91 | 93 | anytime(c("2016-01-31 12:13:14", "2016-08-31 12:13:14"))
|
|
0 commit comments