tests/testthat/test_extract_function_name.r

test_fun <- function(x) {
  print(10 + x)
}

test_that("general test", {
  out <- extract_function_name(test_fun)
  expect_equal(out, "test_fun")
})

test_that("function undefined", {
  expect_equal(extract_function_name(undef), NA_character_)
})

Try the simDAG package in your browser

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

simDAG documentation built on April 3, 2025, 10:35 p.m.