test_vector <- c(
"1 day",
"7 days",
"3 weeks",
"2 month",
"3 years"
)
out_vector <- c(
1, 7, 21, 60, 1068
)
testthat::test_that(
"convert_age does what expected",
{
testthat::expect_equal(
unname(sapply(test_vector, FUN = convert_age)),
out_vector
)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.