From 47fafd1fe12dd02168ef43c017d211246a31a0f6 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Thu, 27 Jul 2023 09:03:16 +0100 Subject: [PATCH] add test --- tests/testthat/test-checks.r | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-checks.r b/tests/testthat/test-checks.r index 38c2006..15c949d 100644 --- a/tests/testthat/test-checks.r +++ b/tests/testthat/test-checks.r @@ -1,4 +1,5 @@ context("Survey data checks") +library(data.table) erroneous_survey <- survey(polymod$participants, polymod$contacts, polymod$reference) @@ -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") })