Skip to content

Commit 1521148

Browse files
authored
GH-46442: [R] hms::as_hms tests fail on some of our crossbow builds (#46443)
### Rationale for this change New functionality breaks tests with minimal builds ### What changes are included in this PR? Skip tests on those builds ### Are these changes tested? Updates are to tests ### Are there any user-facing changes? No * GitHub Issue: #46442 Authored-by: Nic Crane <thisisnic@gmail.com> Signed-off-by: Nic Crane <thisisnic@gmail.com>
1 parent b71f629 commit 1521148

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

r/tests/testthat/test-dplyr-funcs-datetime.R

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3764,7 +3764,6 @@ test_that("hms::hms", {
37643764
call_binding("hms::hms", seconds = NA),
37653765
regexp = "All arguments must be numeric or NA_real_"
37663766
)
3767-
37683767
})
37693768

37703769
test_that("hms::as_hms", {
@@ -3773,13 +3772,12 @@ test_that("hms::as_hms", {
37733772
int = c(30L, 75L),
37743773
integerish_dbl = c(31, 76),
37753774
dbl = c(31.2, 76.4),
3776-
datetime = as.POSIXct(c(1645243500, 1745243500), tz = "UTC")
3775+
datetime = as.POSIXct(c(1645243500, 1745243500), tz = "UTC", origin = "1970-01-01")
37773776
)
37783777

37793778
compare_dplyr_binding(
37803779
.input %>%
37813780
mutate(
3782-
x = hms::as_hms(hms_string),
37833781
x2 = hms::as_hms(int),
37843782
x3 = hms::as_hms(integerish_dbl),
37853783
x4 = hms::as_hms(datetime)
@@ -3792,4 +3790,15 @@ test_that("hms::as_hms", {
37923790
arrow_table(test_df) %>% mutate(y = hms::as_hms(dbl)) %>% collect(),
37933791
"was truncated converting to int32"
37943792
)
3793+
3794+
skip_if_not_available("utf8proc")
3795+
3796+
compare_dplyr_binding(
3797+
.input %>%
3798+
mutate(
3799+
x = hms::as_hms(hms_string),
3800+
) %>%
3801+
collect(),
3802+
test_df
3803+
)
37953804
})

0 commit comments

Comments
 (0)