Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Jul 28, 2023
1 parent ac0a779 commit 47fafd1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/testthat/test-checks.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
context("Survey data checks")
library(data.table)

erroneous_survey <- survey(polymod$participants, polymod$contacts, polymod$reference)

Expand All @@ -20,6 +21,10 @@ erroneous_structure3 <- copy(erroneous_survey)
erroneous_structure3$contacts$cnt_age_est_min <- NULL

test_that("incorrect structure of data frames is correctly identified", {
expect_warning(check(erroneous_structure1))
expect_warning(check(erroneous_structure2))
expect_warning(check(erroneous_structure1), "does not exist")
expect_warning(check(erroneous_structure2), "does not exist")
})

test_that("deprecated arguments are warned about", {
expect_warning(check(polymod, columns = TRUE), "deprecated")
})

0 comments on commit 47fafd1

Please sign in to comment.