tests/testthat/test-set_id.R

test_that("Set id works", {
  expect_equal(as.character(set_id(1, rjson::toJSON(list("test" = 1)))), "{\"test\":1,\"id\":\"1\"}")
})

test_that("Set no id works", {
  expect_equal(as.character(set_id(NA, rjson::toJSON(list("test" =  1)))), "{\"test\":1}")
})

Try the simplegraphdb package in your browser

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

simplegraphdb documentation built on March 12, 2021, 5:05 p.m.