tests/testthat/test-loaded-packages.R

test_that("loaded_packages", {
  lp <- loaded_packages()
  expect_equal(sort_ci(lp$package), sort_ci(loadedNamespaces()))
  expect_identical(
    gsub("-", ".", lp$loadedversion),
    unlist(lapply(lp$package, function(x) as.character(packageVersion(x))))
  )
  expect_true(all(file.exists(lp$path)))
  expect_equal(
    paste0("package:", lp$package) %in% search(),
    lp$attached
  )
})

Try the sessioninfo package in your browser

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

sessioninfo documentation built on Dec. 11, 2021, 9:07 a.m.