tests/testthat/test-get_all_created_funs.R

# WARNING - Generated by {fusen} from dev/flat_get_package_structure.Rmd: do not edit by hand

test_that("get_all_created_funs works", {
  expect_true(inherits(get_all_created_funs, "function"))

  file_path <- tempfile(fileext = ".R")
  cat(
    "my_fun <- function() {1}",
    "my_fun2 <- function() {2}",
    sep = "\n",
    file = file_path
  )
  expect_equal(
    get_all_created_funs(file_path),
    c("my_fun", "my_fun2")
  )
})

Try the fusen package in your browser

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

fusen documentation built on May 29, 2024, 6:42 a.m.