tests/testthat/test-int64-double.R

test_that("unsigned int64 to double works", {
  
  str <- '[1.0, 4294967296]'
  robj <- read_json_str(str, int64 = 'double')
  
  expect_true(is.double(robj))
  expect_equal(robj, c(1, 4294967296))
})



test_that("signed int64 to double works", {
  
  str <- '[1.0, -4294967296]'
  robj <- read_json_str(str, int64 = 'double')
  
  expect_true(is.double(robj))
  expect_equal(robj, c(1, -4294967296))
})

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.