Nothing
# Initialisation ---------------------------------------------------------------
set.seed(2038L)
# Tests de résultats positifs --------------------------------------------------
testthat::test_that("good result for Date", {
list_date <- c(Sys.Date(), create_random_type("Date", len = 10L))
for (k in seq_along(list_date)) {
date <- list_date[k]
res <- testthat::expect_silent(assert_scalar_date(x = date))
testthat::expect_identical(res, date)
}
})
# Tests de résultats négatifs --------------------------------------------------
testthat::test_that("Several Date are not allowed", {
testthat::expect_error(
assert_scalar_date(x = seq(from = as.Date("2023-08-04"), to = Sys.Date(), by = "months"))
)
for (len in list_len[-2L]) {
testthat::expect_error(
assert_scalar_date(x = create_random_type("Date", len = len))
)
}
})
testthat::test_that("miscellaneous Object are not allowed", {
for (wrong_date in object_bank_R[-34L]) {
testthat::expect_error(
assert_scalar_date(x = wrong_date)
)
}
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.