tests/testthat/test-writeijzip.R

context("Writing a list of ROIs to a zip archive")

path <- file.path(system.file(package = "RImageJROI"), "extdata", "ijroi")

testthat::test_that("ROI zip files read and wrote are consistent", {
  roizip_infile <- file.path(path, "ijzip.zip")
  roizip_outfile <- file.path(tempdir(), "ijzip.zip")
  unlink(roizip_outfile)

  r <- RImageJROI::read.ijzip(roizip_infile)

  RImageJROI::write.ijzip(file = roizip_outfile, roi = r, verbose = FALSE)
  r_2 <- RImageJROI::read.ijzip(file = roizip_outfile, verbose = FALSE)

  testthat::expect_identical(r, r_2)
})

Try the RImageJROI package in your browser

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

RImageJROI documentation built on Sept. 11, 2024, 8:09 p.m.