tests/testthat/test-topology_stats.R

context("topology_stats")

test_that("usage", {
  testthat::skip_on_cran() # these tests take very long
  set.seed(42)
  focal_tree <- ape::rphylo(n = 16, birth = 1, death = 0)

  testthat::expect_invisible(
    all_stats <- treestats::calc_topology_stats(focal_tree)
  )
  testthat::expect_equal(length(all_stats), 40)

  testthat::expect_invisible(
    all_stats <- treestats::calc_topology_stats(focal_tree,
                                               normalize = TRUE)
  )
  testthat::expect_equal(length(all_stats), 40)
})

Try the treestats package in your browser

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

treestats documentation built on Sept. 14, 2024, 9:08 a.m.