tests/testthat/test-validate_arg_function_name.R

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

  x <- validate_arg_function_name(
    default_name = NULL,
    function_name = NULL
  )

  testthat::expect_null(x)

  x <- validate_arg_function_name(
    default_name = "hola",
    function_name = NULL
  )

  testthat::expect_true(
    x == "hola"
  )

  x <- validate_arg_function_name(
    default_name = "hola",
    function_name = "adios"
  )

  testthat::expect_true(
    grepl(pattern = "hola", x = x)
  )

  testthat::expect_true(
    grepl(pattern = "adios", x = x)
  )
})

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.