tests/testthat/test-utils-misc.R

pdf_file <- tempfile(fileext = ".pdf")
svg_file <- tempfile(fileext = ".svg")

old_dev <- dev.cur()
pdf(pdf_file)
expect_false(device_supports_unicode())
dev.off()
if (old_dev > 1L) {
	dev.set(old_dev)
}
unlink(pdf_file)

skip_if(!capabilities("cairo"))
old_dev <- dev.cur()
svg(svg_file)
expect_true(device_supports_unicode())
dev.off()
if (old_dev > 1L) {
	dev.set(old_dev)
}
unlink(svg_file)

Try the piecepackr package in your browser

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

piecepackr documentation built on May 12, 2026, 9:07 a.m.