tests/testthat/helper-common_vars.R

x_valid <- '{"a":1}'
x_invalid <- '{"a": 1'
x_json2 <- json2(x_valid)
x_pq_json <- structure(x_valid, class = "pq_jsonb")
x_jqson <- structure(x_valid, class = c("jqson", "character"))
x_jsonlite <- structure(x_valid, class = "json")

expect_invalid_json <- function(object, offsets, locations) {
  err <- expect_error(object, class = "jsontools_error_invalid_json")
  expect_equal(err$offsets, offsets)
  expect_equal(err$locations, locations)
}

tibble <- tibble::tibble

Try the jsontools package in your browser

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

jsontools documentation built on March 22, 2021, 5:06 p.m.