tests/testthat/test-yyjson-flags.R

test_that("yyjson flags work", {
  

  expect_error(
    capture_output(
      read_json_str('[1,2,3,]'), 'comma'
    )
  )
  
  expect_equal(
    read_json_str('[1,2,3,]', yyjson_read_flag = yyjson_read_flag$YYJSON_READ_ALLOW_TRAILING_COMMAS),
    c(1L, 2L, 3L)
  )
  
})

Try the yyjsonr package in your browser

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

yyjsonr documentation built on May 29, 2024, 3:01 a.m.