tests/testthat/test-validate_arg_df_not_null.R

testthat::test_that("`validate_arg_df_not_null()` works", {
  testthat::skip_on_cran()

  data(vi_smol)

  testthat::expect_error(
    x <- validate_arg_df_not_null(
      df = NULL
    ),
    regexp = "argument 'df' cannot be NULL"
  )

  x <- validate_arg_df_not_null(
    df = vi_smol
  )

  testthat::expect_true(
    all.equal(vi_smol, x)
  )

  df <- vi_smol

  attr(x = df, which = "validated") <- TRUE

  x <- validate_arg_df_not_null(
    df = df
  )
})

Try the collinear package in your browser

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

collinear documentation built on Dec. 8, 2025, 5:06 p.m.