test_that("Checking anlz_yrattain 2018", {
result <- anlz_yrattain(epcdata, 2018) %>%
pull(outcome)
expect_equal(c('yellow', 'green', 'green', 'green'), result)
})
test_that("Checking anlz_yrattain 1984", {
result <- anlz_yrattain(epcdata, 1984) %>%
pull(outcome)
expect_equal(c('red', 'green', 'red', 'yellow'), result)
})
test_that("Checking anlz_yrattain error for year", {
expect_error(anlz_yrattain(epcdata, yrsel = 1900))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.