tests/testthat/test-s3-xml_document.R

test_that("xml_document", {
  expect_snapshot({
    x <- xml2::read_xml("<foo><bar /></foo>")
    construct(x)
    construct(x, opts_xml_document(simplify = FALSE))
    construct(x, opts_xml_document("next"), check = FALSE)
    y <- xml2::read_html("<foo><bar /></foo>")
    construct(y)
    construct(y, opts_xml_document(simplify = FALSE))
    construct(y, opts_xml_document("next"), check = FALSE)
  })
})

Try the constructive package in your browser

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

constructive documentation built on Nov. 5, 2025, 7:14 p.m.