tests/testthat/test-04a_showLibs.R

test_that("showLibs returns correct type", {
  expect_equal(showLibs("pkgDoesNotExist123"),
               list(pkgDoesNotExist123 = "Package not installed"))
  expect_type(showLibs(), "list")
  someLibs <- c("ggplot2", "INWTUtils", "stats", "lintr")
  expect_named(showLibs(someLibs), someLibs)
  expect_true(lapply(showLibs(someLibs), function(x) {
    class(x) == "character"
  }) %>% unlist %>% all)
})
INWT/INWTUtils documentation built on May 22, 2024, 4:45 p.m.