tests/testthat/test-get_relatives.R

context("recover children or parents")

Ebenaceae <- subset(Easplist, charmatch("Ebenaceae", TaxonName))
Diostri <- subset(Easplist, TaxonName == "Diospyros tricolor")

test_that("get_children works", {
  expect_true(nrow(Ebenaceae@taxonRelations) <
    nrow(get_children(
      Easplist,
      Ebenaceae
    )@taxonRelations))
})

test_that("get_parents works", {
  expect_true(nrow(Diostri@taxonRelations) <
    nrow(get_parents(
      Easplist,
      Diostri
    )@taxonRelations))
})
kamapu/taxlist documentation built on Feb. 17, 2024, 8:27 a.m.