tests/testthat/test-raster.R

library(xml2)

test_that("raster exists", {
  x <- xmlSVG(
    {
      image(matrix(runif(64), nrow = 8), useRaster = TRUE)
    },
    standalone = TRUE
  )
  ns <- xml_ns(x)

  img <- xml_attr(
    xml_find_all(x, ".//d1:image", ns = ns),
    "xlink:href",
    ns = ns
  )
  expect_gt(nchar(img), 1000)
})

Try the svglite package in your browser

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

svglite documentation built on June 8, 2025, 1:46 p.m.