context("verify_colnames")
test_that("Correct entries are successful.",{
expect_warning(verify_colnames(minimal_entry))
expect_true(verify_colnames(full_entry_score))
expect_true(verify_colnames(full_entry_hosp_score))
expect_true(verify_colnames(full_entry_state_score))
})
test_that("Missing columns report errors.", {
for (i in seq_along(colnames(minimal_entry))) {
tmp_entry <- minimal_entry[,-i]
expect_error(verify_colnames(tmp_entry))
}
})
# test_that("Missing forecast_week reports warning", {
# expect_warning(verify_colnames(minimal_entry))
# expect_warning(verify_colnames(full_entry))
# })
test_that("Extra column report warnings.", {
tmp_entry <- minimal_entry
tmp_entry$extra_column = NA
expect_warning(verify_colnames(tmp_entry))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.