You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test_that("can promote vroom parse warning to error", {
make_warning<-function() {
x<- vroom(
I("a,b\n1.0,x\n"),
delim=",",
col_types="dd"
)
# Warning happens at print time so force a print
print(x)
}
expect_error(
# This fails hard if we unwind protect the warning (aborts RStudio)
# - Try to throw error after catching the warning
withCallingHandlers(
expr= make_warning(),
vroom_parse_issue=function(cnd) {
rlang::abort("oh no")
}
)
)
})
In a PR to update the warning message from problems() we attempted to use cpp11::package() to call cli::cli_warn(). For a number of reasons this isn't a great idea and can actually crash R #441 (comment)
At the time we wrote the test, we didn't fully understand the circumstances that caused the crash. Now that we are more aware of how it occurs, we should update the test to reflect this information.
The text was updated successfully, but these errors were encountered:
The test in question:
vroom/tests/testthat/test-problems.R
Lines 149 to 172 in f21f314
In a PR to update the warning message from
problems()
we attempted to usecpp11::package()
to callcli::cli_warn()
. For a number of reasons this isn't a great idea and can actually crash R #441 (comment)At the time we wrote the test, we didn't fully understand the circumstances that caused the crash. Now that we are more aware of how it occurs, we should update the test to reflect this information.
The text was updated successfully, but these errors were encountered: