Skip to content

Commit

Permalink
test: improve neighbors() tests
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
maelle authored and aviator-bot committed May 20, 2024
1 parent fd83087 commit 0e75241
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/testthat/test-neighbors.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
test_that("neighbors works", {
g <- sample_gnp(100, 20 / 100)
al <- as_adj_list(g, mode = "all")
for (i in 1:length(al)) {
n <- neighbors(g, i, mode = "out")
expect_that(sort(n), is_equivalent_to(al[[i]]))
for (i in seq_along(al)) {
n <- neighbors(g, v = i, mode = "out")
expect_setequal(sort(n), al[[i]])
}
})

Expand Down

0 comments on commit 0e75241

Please sign in to comment.