tests/testthat/test_format_csvy.R

context("CSVY imports/exports")
require("datasets")

tmp <- tempfile(fileext = ".csvy")

test_that("Export to CSVY", {
    suppressWarnings(expect_true(file.exists(export(iris, tmp))))
})

test_that("Import from CSVY", {
    suppressWarnings(d <- import(tmp))
    expect_true(inherits(d, "data.frame"))
})

unlink(tmp)

Try the rio package in your browser

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

rio documentation built on Sept. 19, 2023, 5:06 p.m.