tests/testthat/test_write_x3p.R

context("write_x3p")


test_that("write_x3p works as expected", {
  tmpfile <- tempfile(fileext = ".x3p")
  # write a copy of the file into a temporary file
  write_x3p(x3ptest, file = tmpfile, quiet = T)
  tmpx3p <- read_x3p(tmpfile)
  expect_equivalent(tmpx3p$surface.matrix, x3ptest$surface.matrix)
  expect_equivalent(tmpx3p$header.info$sizeX, x3ptest$header.info$sizeX)
  expect_equivalent(tmpx3p$header.info$sizeY, x3ptest$header.info$sizeY)
  expect_equivalent(tmpx3p$header.info$incrementX, x3ptest$header.info$incrementX)
  expect_equivalent(tmpx3p$header.info$incrementY, x3ptest$header.info$incrementY)

  file.remove(tmpfile)
})

Try the x3ptools package in your browser

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

x3ptools documentation built on Nov. 27, 2021, 1:06 a.m.