tests/testthat/_snaps/s3.md

as_box_if() ensures boxed value if predicate returns TRUE

Code
  (expect_error(as_box_if(NULL, ~10)))
Output
  <error/rlang_error>
  Error in `.p()`:
  ! Predicate functions must return a single `TRUE` or `FALSE`, not the number 10
Code
  (expect_error(as_box_if(NULL, ~ c(TRUE, FALSE))))
Output
  <error/rlang_error>
  Error in `.p()`:
  ! Predicate functions must return a single `TRUE` or `FALSE`, not a logical vector


Try the rlang package in your browser

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

rlang documentation built on Nov. 4, 2023, 9:06 a.m.