tests/testthat/test-hours-year.R

test_that("hours_year works", {
  expect_error(hours_year(1))
  expect_identical(hours_year(ISOdate(2000, 1, 1, 1, tz = "UTC")), 1)
  expect_identical(hours_year(ISOdate(2000, 1, 1, c(1, 3, 1), tz = "UTC")), c(1L, 3, 1))
  expect_identical(hours_year(ISOdate(2001, 1, 1, c(1, 3, 1), tz = "UTC")), c(1, 3, 1))
  expect_identical(hours_year(ISOdate(2001, 1, 2, c(1, 3, 1), tz = "UTC")), c(25, 27, 25))
})

Try the rtide package in your browser

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

rtide documentation built on May 30, 2021, 1:07 a.m.