tests/testthat/test-extractInstallPkg.R

test_argument_validation(
  function_name = "check_install",
  argument_name = "package_name",
  argument_type = "string",
  allow_null = FALSE
)

test_argument_validation(
  function_name = "extractInstallPkg",
  argument_name = "codes",
  argument_type = "string",
  allow_null = FALSE
)


test_that("extractInstallPkg extracts does not extract when package is not called with library", {
  prompt <- "#code tells you to load a library\nx<-5\n mergen::extractInstallPkg()"
  expect_no_message(extractInstallPkg(prompt))
})

Try the mergen package in your browser

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

mergen documentation built on June 27, 2024, 5:10 p.m.