tests/testthat/test-get_exported_functions.R

testthat::test_that("export type is right", {

  export_functions <- get_exported_functions(pkg = "base")
  testthat::expect_type(export_functions, "character")
})


testthat::test_that("export is correct", {

  export_functions <- get_exported_functions(pkg = "base")
  testthat::expect_equal(export_functions[1:5], c("!", "$", "&", "(", "*"))


  export_functions <- get_exported_functions(pkg = "purrr")
  testthat::expect_true(all(c("map", "walk", "imap", "pmap") %in%
                              export_functions))


})

Try the origin package in your browser

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

origin documentation built on April 3, 2025, 11:03 p.m.