test_that("parse_period works", {
expect_snapshot(error = TRUE, parse_period(c(1, 2)))
expect_snapshot(error = TRUE, parse_period(c(1.3)))
expect_snapshot(error = TRUE, parse_period("1 year"))
expect_snapshot(error = TRUE, parse_period("2 weeks later"))
expect_identical(parse_period(1), 1L)
expect_identical(parse_period("1 day"), 1L)
expect_identical(parse_period("1 days"), 1L)
expect_identical(parse_period("1 week"), 7L)
expect_identical(parse_period("1 weeks"), 7L)
expect_identical(parse_period("2 weeks"), 14L)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.