tests/testthat/test_global_ids.R

context("Set global (uuid) identifiers")

test_that("We can generate valid EML with uuid ids on all elements", {
  skip_on_cran()
  
  skip_if_not_installed("geiger")
  skip_if_not_installed("uuid")
  
  if(require("uuid")){
    options(uuid = TRUE)
    require(geiger)
    data(geospiza)
    add_trees(geospiza$phy)
    nexml <- add_characters(geospiza$dat)
    write.nexml(nexml, file = "geospiza.xml")

    expect_true_or_null(nexml_validate("geospiza.xml"))
    unlink("geospiza.xml")
  }
})

Try the RNeXML package in your browser

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

RNeXML documentation built on Feb. 16, 2023, 6:56 p.m.