tests/testthat/test-read-data.R

test_that("vroom's error reaches the user", {
  setup <- parse_setup(NIBRS_sps_name)
  local_mocked_bindings(vroom_fwf = function(...) stop("simulated failure"),
                        .package = "vroom")
  expect_error(read_data(NIBRS_dataset_name, setup), "simulated failure")
})

test_that("reading the data gives no message", {
  setup <- parse_setup(NIBRS_sps_name)
  expect_no_message(read_data(NIBRS_dataset_name, setup))
})

Try the asciiSetupReader package in your browser

Any scripts or data that you put into this service are public.

asciiSetupReader documentation built on Oct. 17, 2026, 5:07 p.m.