tests/testthat/test-convert_to_omv.R

test_that("convert_to_omv works", {
    # check whether writing the data is working (file existence, size, contents [.omv-files are ZIP archives and must contain files that include meta, metadata.json, data.bin])
    nmeInp <- tempfile(fileext = ".rds")
    nmeOut <- tempfile(fileext = ".omv")
    saveRDS(datasets::ToothGrowth, nmeInp)
    convert_to_omv(fleInp = nmeInp, fleOut = nmeOut)
    expect_true(file.exists(nmeOut))
    expect_gt(file.info(nmeOut)$size, 1)
    expect_true(chkFle(nmeOut, isZIP = TRUE))
    expect_true(chkFle(nmeOut, fleCnt = "meta"))
    expect_true(chkFle(nmeOut, fleCnt = "metadata.json"))
    expect_true(chkFle(nmeOut, fleCnt = "data.bin"))
    unlink(nmeInp)
    unlink(nmeOut)
})

Try the jmvReadWrite package in your browser

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

jmvReadWrite documentation built on April 3, 2025, 6:51 p.m.