From 8f027fc51c9d902d4c2ff2ab3129c0e5871d4b69 Mon Sep 17 00:00:00 2001 From: yjunechoe Date: Sun, 4 Aug 2024 13:25:08 +0900 Subject: [PATCH] add sundering test without tbl_checked --- tests/testthat/test-sundering.R | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/testthat/test-sundering.R b/tests/testthat/test-sundering.R index be126edfb..e3a2d0850 100644 --- a/tests/testthat/test-sundering.R +++ b/tests/testthat/test-sundering.R @@ -548,3 +548,23 @@ test_that("an error occurs if using `get_sundered_data()` when agent has no inte get_sundered_data() ) }) + +test_that("an error occurs if using `get_sundered_data()` when agent is missing `$tbl_checked`", { + + # Expect an error if the agent performed an interrogation + # with `extract_tbl_checked = FALSE` + expect_error( + create_agent(tbl = small_table) %>% + col_vals_gt(vars(date_time), vars(date), na_pass = TRUE) %>% + col_vals_gt(vars(b), vars(g), na_pass = TRUE) %>% + rows_distinct(vars(d, e)) %>% + rows_distinct(vars(a, f)) %>% + col_vals_gt(vars(d), 100) %>% + col_vals_equal(vars(d), vars(d), na_pass = TRUE) %>% + col_vals_between(vars(c), left = vars(a), right = vars(d), na_pass = TRUE) %>% + interrogate(extract_tbl_checked = FALSE) %>% + get_sundered_data(), + "missing `tbl_checked`" + ) +}) +