Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/testthat/test-full-seq.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test_that("works with Date", {
})

test_that("works with hms/difftime", {
skip_if_not_installed("hms")
x <- hms::hms(hours = 0:1)
y <- as.difftime(c(0, 1800, 3600), units = "secs")
expect_equal(fullseq(x, 1800), y)
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-label-date.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ test_that("time_format works correctly", {
na_time <- ISOdatetime(NA, 1, 1, 1, 1, 0) # time of value NA

expect_equal(time_format()(a_time), "11:30:00")
expect_equal(time_format()(na_time), NA_character_

skip_if_not_installed("hms")
expect_equal(time_format()(hms::as_hms(a_time)), "11:30:00")
expect_equal(time_format(format = "%H")(hms::as_hms(a_time)), "11")
expect_equal(time_format()(na_time), NA_character_)
})

test_that("can set locale", {
Expand All @@ -28,6 +30,7 @@ test_that("can set locale", {
})

test_that("label_date_short can replace leading zeroes", {
skip_if_not_installed("stringi")
x <- seq(as.Date("2024-01-01"), as.Date("2025-01-01"), by = "1 month")
labels <- label_date_short(
format = c("%Y", "%m", "%d"),
Expand Down
Loading