tests/testthat/helper-cast.R

expect_lossy_cast <- function(expr) {
  cnd <- NULL

  out <- with_handlers(
    warning = calling(function(x) {
      cnd <<- x
      cnd_muffle(x)
    }),
    expr
  )
  expect_s3_class(cnd, "vctrs_warning_cast_lossy")

  out
}

Try the vctrs package in your browser

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

vctrs documentation built on Oct. 13, 2023, 1:05 a.m.