test_that("collectFunNames works", { system.file("extdata", package = "pkgGraphR") |> collectFunNames() |> expect_error() system.file("extdata", package = "pkgGraphR") |> collectFunNames(is.package = FALSE, verbose = TRUE) |> expect_warning() system.file("extdata", package = "pkgGraphR") |> collectFunNames(is.package = FALSE, verbose = FALSE) |> expect_type("list") |> expect_length(1) |> expect_named() }) test_that("buildPackageGraph works", { system.file("extdata", package = "pkgGraphR") |> buildPackageGraph(is.package = FALSE, verbose = T) |> expect_warning() system.file("extdata", package = "pkgGraphR") |> buildPackageGraph(is.package = FALSE) |> expect_type("list") |> expect_length(2) |> expect_named() }) test_that("plotPackageGraph works", { plotPackageGraph() |> expect_error() system.file("extdata", package = "pkgGraphR") |> buildPackageGraph(is.package = FALSE) |> plotPackageGraph(x = system.file("extdata", package = "pkgGraphR"), graph = _, style = "grViz") |> expect_warning() system.file("extdata", package = "pkgGraphR") |> plotPackageGraph(is.package = FALSE, style = "grViz") |> inherits("grViz") |> expect_equal(TRUE) system.file("extdata", package = "pkgGraphR") |> buildPackageGraph(is.package = FALSE) |> plotPackageGraph(graph = _, style = "mermaid") |> inherits("DiagrammeR") |> expect_equal(TRUE) system.file("extdata", package = "pkgGraphR") |> buildPackageGraph(is.package = FALSE) |> plotPackageGraph(graph = _, style = "ggraph") |> inherits("ggraph") |> expect_equal(TRUE) })