Skip to content

Commit

Permalink
add sundering test without tbl_checked
Browse files Browse the repository at this point in the history
  • Loading branch information
yjunechoe committed Aug 4, 2024
1 parent 5da79bb commit 8f027fc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/testthat/test-sundering.R
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
)
})

0 comments on commit 8f027fc

Please sign in to comment.