dwww Home | Show directory contents | Find package

# ------------------------------------------------------------------------------
# invalid_remove()

test_that("can remove invalid dates from calendar types", {
  x <- year_month_day(2020, 2, 28:30)
  expect_identical(invalid_remove(x), x[1:2])

  x <- year_day(2019, 365:366)
  expect_identical(invalid_remove(x), x[1L])
})

test_that("errors on unsupported types", {
  expect_snapshot_error(invalid_remove(1))
})

Generated by dwww version 1.15 on Sat May 18 07:30:37 CEST 2024.