tests/testthat/test_io.R

##
## Author: Chris Bielow
##

test_that("readMZQC and writeMZQC", {
  fp = system.file("testdata", "test.mzQC", package="rmzqc")
  fp
  mq = readMZQC(fp)
  f.mq = tempfile(pattern = "tmp", fileext = ".mzQC");
  writeMZQC(f.mq, mq)
  mq2 = readMZQC(f.mq)
  ## cannot compare mqQC objects. But JSON can...
  j.mq = jsonlite::toJSON(mq)
  j.mq2 = jsonlite::toJSON(mq2)

  expect_true(j.mq == j.mq2)
})

Try the rmzqc package in your browser

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

rmzqc documentation built on May 29, 2024, 12:06 p.m.