tests/testthat/test-update.R

test_that("Can't update units", {
  x <- hms(minutes = 3)
  expect_equal(units(x), "secs")
  expect_warning(units(x) <- "mins", "always uses seconds")
  expect_equal(units(x), "secs")
  expect_warning(units(x) <- "secs", NA)
  expect_equal(units(x), "secs")
})

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.