tests/testthat/test-has_parents.R

test_that("has_parent on non existing node should error", {
  graph <- graph_builder() |>
    add_path(c("1", "2", "3")) |>
    build_directed()

  expect_equal(has_parents(graph, "3"), TRUE)
  expect_error(has_parents(graph, "4"))
})

Try the orbweaver package in your browser

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

orbweaver documentation built on June 8, 2025, 11:40 a.m.