tests/testthat/test-utils-cff-ref.R

test_that("fallback_dates normalizes reference dates", {
  xinit <- list(year = "2025")
  p <- fallback_dates(list(year = "2025"))
  expect_identical(xinit, p)

  p2 <- fallback_dates(list("date-published" = "2025-09-25"))
  expect_snapshot(as_cff(p2))
})

Try the cffr package in your browser

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

cffr documentation built on Aug. 24, 2026, 5:11 p.m.