Skip to content

Commit

Permalink
test: is_biconnected()
Browse files Browse the repository at this point in the history
  • Loading branch information
szhorvat committed Feb 5, 2024
1 parent c510587 commit aea50cb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test-biconnected.components.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,20 @@ test_that("biconnected_components works", {
expect_that(sortlist(bc$components), equals(list(1:5, c(1, 6), 6:10)))
expect_that(sort(as.vector(bc$articulation_points)), equals(c(1, 6)))
})

test_that("is_biconnected works", {
g <- make_full_graph(0)
expect_that(! is_biconnected(g))

g <- make_full_graph(1)
expect_that(! is_biconnected(g))

g <- make_full_graph(2)
expect_that(is_biconnected(g))

g <- make_full_graph(3)
expect_that(is_biconnected(g))

g <- make_graph(c(1,2, 2,3, 3,1, 1,4, 4,4))
expect_that(!is_biconnected(g))
})

0 comments on commit aea50cb

Please sign in to comment.