tests/testthat/test-save.R

test_that("plot save works", {

  tempimage <- paste0(tempfile(), ".png")
  dat <- flametree_grow()
  pic <- flametree_plot(dat)

  expect_false(file.exists(tempimage))
  flametree_save(pic, tempimage)
  expect_true(file.exists(tempimage))
  file.remove(tempimage)
  expect_false(file.exists(tempimage))

})

Try the flametree package in your browser

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

flametree documentation built on Nov. 29, 2021, 9:12 a.m.