tests/testthat/test-ndjson-raw-io.R

test_that("ndjson raw io works", {

  dat <- head(mtcars)
  rownames(dat) <- NULL
  
  js <- write_ndjson_raw(dat)
  expect_true(is.raw(js))
  res <- read_ndjson_raw(js, 'df')
  expect_identical(res, dat)
  
  
  res <- read_ndjson_raw(js, 'list')
  expect_true(is.list(res))
  
})

Try the yyjsonr package in your browser

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

yyjsonr documentation built on June 8, 2025, 10:47 a.m.