tests/testthat/test-validate_arg_quiet.R

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

  testthat::expect_true(
    validate_arg_quiet(
      quiet = TRUE
    )
  )

  testthat::expect_false(
    validate_arg_quiet(
      quiet = FALSE
    )
  )

  testthat::expect_false(
    validate_arg_quiet()
  )

  testthat::expect_message(
    x <- validate_arg_quiet(
      quiet = "a"
    ),
    regexp = "argument 'quiet' must be logical"
  )

  testthat::expect_true(
    x == FALSE
  )

  testthat::expect_true(
    attributes(x)$validated
  )

  x <- validate_arg_quiet(
    quiet = x
  )

  testthat::expect_true(
    attributes(x)$validated
  )
})

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.