tests/testthat/test-download-dataset.R

test_that("download_ces_dataset validates inputs correctly", {
  # Test that invalid year throws error
  expect_error(download_ces_dataset("9999"), "Invalid year")
  
  # Test that a non-existent year is detected
  expect_error(download_ces_dataset("2022"), "Invalid year")
})

Try the ces package in your browser

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

ces documentation built on Aug. 29, 2025, 5:26 p.m.