From 42c475a81e1fc46c11c7d37e1c1a6397527ca495 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 12 Sep 2023 14:53:44 +0200 Subject: [PATCH] add tests --- tests/testthat/test-seek_data.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/testthat/test-seek_data.R b/tests/testthat/test-seek_data.R index 5d3183906..01bff9807 100644 --- a/tests/testthat/test-seek_data.R +++ b/tests/testthat/test-seek_data.R @@ -70,3 +70,8 @@ test_that("seek_variables - multiple pattern", { expect_identical(out$index, which(colnames(efc) %in% out$column)) expect_identical(out$labels, c("elder's gender", "elder's dependency")) }) + +test_that("seek_variables - valid input", { + expect_error(seek_variables(rnorm(10), "Length"), regex = "`data` must be a data frame.") + expect_error(seek_variables(iris, "Length", search = "somewhere"), regex = "`search` must be") +})