tests/testthat/test-minimal.st.separators.R

test_that("min_st_separators works", {
  g <- make_graph("Zachary")
  msts <- min_st_separators(g)
  is <- sapply(msts, is_separator, graph = g)
  expect_equal(unique(is), TRUE)

  ## TODO: check that it is minimal
})

test_that("min_st_separators() works for the note case", {
  g <- make_graph(~ 0 - 1 - 2 - 3 - 4 - 1)
  expect_snapshot(
    min_st_separators(g),
    transform = function(x) gsub("from.*", "from something", x)
  )
})

Try the igraph package in your browser

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

igraph documentation built on Oct. 20, 2024, 1:06 a.m.