diff --git a/R/structural.properties.R b/R/structural.properties.R index ca1029e1420..30cb7d930d9 100644 --- a/R/structural.properties.R +++ b/R/structural.properties.R @@ -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) { @@ -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 diff --git a/tests/testthat/_snaps/structural.properties.md b/tests/testthat/_snaps/structural.properties.md index d8f926aeba1..55f08216249 100644 --- a/tests/testthat/_snaps/structural.properties.md +++ b/tests/testthat/_snaps/structural.properties.md @@ -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. --- @@ -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 diff --git a/tests/testthat/test-structural.properties.R b/tests/testthat/test-structural.properties.R index 15089e98d3f..de12134cf12 100644 --- a/tests/testthat/test-structural.properties.R +++ b/tests/testthat/test-structural.properties.R @@ -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, @@ -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,