tests/testthat/test-plot_phylod.R

test_that("plot_phylod runs silent without error", {
  phylod <- create_test_phylod(test_scenario = 1)
  expect_silent(plot_phylod(phylod = phylod, node_pies = FALSE))
})

test_that("plot_phylod runs silent without error", {
  phylod <- create_test_phylod(test_scenario = 2)
  expect_silent(plot_phylod(phylod = phylod, node_pies = FALSE))
})

test_that("plot_phylod runs silent without error", {
  phylod <- create_test_phylod(test_scenario = 1)
  expect_silent(plot_phylod(phylod = phylod, node_pies = TRUE))
})

test_that("plot_phylod runs silent without error", {
  phylod <- create_test_phylod(test_scenario = 2)
  expect_silent(plot_phylod(phylod = phylod, node_pies = TRUE))
})

test_that("plot_phylod fails correctly without node data", {
  phylod <- create_test_phylod(test_scenario = 1)
  phylobase::tdata(phylod) <- data.frame(
    endemicity_status = phylobase::tdata(phylod)[, 1]
  )
  expect_error(
    object = plot_phylod(phylod = phylod, node_pies = TRUE),
    regexp = "To plot probabilities in at the nodes they must be in phylod"
  )
})

Try the DAISIEprep package in your browser

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

DAISIEprep documentation built on April 3, 2025, 9:26 p.m.