tests/testthat/test-xml_to_json.R

testthat::context("xml to json")

library(nexld)


testthat::test_that("we can parse xml into a json-list", {

  ex <- system.file("extdata/example.xml", package = "nexld")
  json <- xml_to_json(ex)
  testthat::expect_is(json, "json")
  nexld <- parse_nexml(ex)
  testthat::expect_equal(nexld$trees$tree[["@id"]], "tree1")
})
cboettig/nexld documentation built on Sept. 18, 2019, 7:11 a.m.