tests/testthat/test-find_nodes.R

test_that("test_nodes works", {
  expect_equal(find_nodes(list("name"="Steve Jobs")), "SELECT body FROM nodes WHERE json_extract(body, '$.name') = \"Steve Jobs\"")
  expect_equal(find_nodes(list("name"="Steve Jobs"), search_fn = "search_like"), "SELECT body FROM nodes WHERE json_extract(body, '$.name') LIKE \"Steve Jobs\"")
  expect_equal(find_nodes(list("name"="Steve"), where_fn = "search_starts_with"), "SELECT body FROM nodes WHERE json_extract(body, '$.name') = \"%Steve\"")
  expect_equal(find_nodes(list("name"="Steve"), where_fn = "search_contains"), "SELECT body FROM nodes WHERE json_extract(body, '$.name') = \"%Steve%\"")
})

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.