tests/testthat/helper-compare.R

expect_hms_equal <- function(x, y) {
  expect_s3_class(x, "hms")
  expect_s3_class(y, "hms")
  expect_equal(as.numeric(x), as.numeric(y))
}

expect_difftime_equal <- function(x, y) {
  expect_s3_class(x, "difftime")
  expect_s3_class(y, "difftime")
  expect_equal(as.numeric(as_hms(x)), as.numeric(as_hms(y)))
}

Try the hms package in your browser

Any scripts or data that you put into this service are public.

hms documentation built on March 31, 2023, 11:09 p.m.