Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions R/structural.properties.R
Original file line number Diff line number Diff line change
Expand Up @@ -2140,14 +2140,11 @@ bfs <- function(
ensure_igraph(graph)

if (lifecycle::is_present(neimode)) {
lifecycle::deprecate_warn(
lifecycle::deprecate_stop(
"1.3.0",
"bfs(neimode)",
"bfs(mode)"
)
if (missing(mode)) {
mode <- neimode
}
}

if (length(root) == 1) {
Expand Down Expand Up @@ -2315,14 +2312,11 @@ dfs <- function(graph, root, mode = c("out", "in", "all", "total"),
rho = parent.frame(), neimode = deprecated()) {
ensure_igraph(graph)
if (lifecycle::is_present(neimode)) {
lifecycle::deprecate_warn(
lifecycle::deprecate_stop(
"1.3.0",
"dfs(neimode)",
"dfs(mode)"
)
if (missing(mode)) {
mode <- neimode
}
}

root <- as_igraph_vs(graph, root) - 1
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/_snaps/structural.properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Code
d <- dfs(g, root = 2, unreachable = FALSE, neimode = "out")
Condition
Warning:
The `neimode` argument of `dfs()` is deprecated as of igraph 1.3.0.
Error:
! The `neimode` argument of `dfs()` was deprecated in igraph 1.3.0 and is now defunct.
i Please use the `mode` argument instead.

---
Expand All @@ -13,8 +13,8 @@
b <- bfs(g, root = 2, neimode = "out", unreachable = FALSE, order = TRUE, rank = TRUE,
father = TRUE, pred = TRUE, succ = TRUE, dist = TRUE)
Condition
Warning:
The `neimode` argument of `bfs()` is deprecated as of igraph 1.3.0.
Error:
! The `neimode` argument of `bfs()` was deprecated in igraph 1.3.0 and is now defunct.
i Please use the `mode` argument instead.

# bfs() works
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-structural.properties.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test_that("dfs() does not pad order", {
test_that("bfs() deprecated argument", {
g <- make_star(3)

expect_snapshot({
expect_snapshot(error = TRUE, {
d <- dfs(
g,
root = 2,
Expand Down Expand Up @@ -199,7 +199,7 @@ test_that("bfs() works", {
test_that("bfs() deprecated argument", {
g <- graph_from_literal(a - +b - +c, z - +a, d)

expect_snapshot({
expect_snapshot(error = TRUE, {
b <- bfs(
g,
root = 2,
Expand Down