tests/testthat/test-internal_functions.R

# Test .validate_dates() -----
test_that(".validate_dates() checks for backwards dates properly", {
  x <-  c("2015-01-15", "2015-01-14")
  expect_error(.validate_dates(x, availability = c("1981-01-01", "0")),
               regexp = "Please check your dates.*")
})

test_that(".validate_dates() allows for one day to be fetched", {
  x <-  c("2015-01-15", "2015-01-15")
  expect_error(.validate_dates(x, availability = c("1981-01-01", "0")), NA)
})

Try the chirps package in your browser

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

chirps documentation built on Nov. 4, 2026, 1:12 a.m.