diff --git a/tests/testthat/test-centrality.R b/tests/testthat/test-centrality.R index a94168d028..8b91dea930 100644 --- a/tests/testthat/test-centrality.R +++ b/tests/testthat/test-centrality.R @@ -177,7 +177,7 @@ test_that("hits_scores(scale = ) is deprecated but still works", { rlang::local_options(lifecycle_verbosity = "warning") g <- make_star(10) - expect_snapshot( + expect_snapshot_igraph( res_legacy <- hits_scores(g, scale = FALSE) ) # ARPACK starts from a random vector, so compare with a tolerance. @@ -186,7 +186,7 @@ test_that("hits_scores(scale = ) is deprecated but still works", { hits_scores(g, normalized = FALSE)[c("hub", "authority")] ) - expect_snapshot( + expect_snapshot_igraph( error = TRUE, hits_scores(g, normalized = FALSE, scale = FALSE) ) @@ -1330,7 +1330,7 @@ test_that("alpha_centrality() covers migrated tail args and positional recovery" test_that("closeness(vids = ) is deprecated but still works", { rlang::local_options(lifecycle_verbosity = "warning") g <- make_ring(10) - expect_snapshot( + expect_snapshot_igraph( res_legacy <- closeness(g, vids = 1:3) ) expect_identical(res_legacy, closeness(g, vertices = 1:3)) diff --git a/tests/testthat/test-games.R b/tests/testthat/test-games.R index 7ef455084c..b7b2826550 100644 --- a/tests/testthat/test-games.R +++ b/tests/testthat/test-games.R @@ -1774,7 +1774,7 @@ test_that("sample_grg(nodes = ) is deprecated but still works", { igraph_local_seed(42) expected <- sample_grg(n = 10, radius = 1) igraph_local_seed(42) - expect_snapshot( + expect_snapshot_igraph( g <- sample_grg(nodes = 10, radius = 1) ) expect_identical_graphs(g, expected) diff --git a/tests/testthat/test-interface.R b/tests/testthat/test-interface.R index 3d0ab0a912..d5460e5b21 100644 --- a/tests/testthat/test-interface.R +++ b/tests/testthat/test-interface.R @@ -141,7 +141,7 @@ test_that("legacy matrix warnings name the calling package (#1827)", { test_that("add_edges warning for legacy matrices", { rlang::local_options(lifecycle_verbosity = "warning") g <- make_empty_graph(5) - expect_snapshot({ + expect_snapshot_igraph({ . <- add_edges(g, matrix(c(1, 2, 3, 4), nrow = 2)) . <- add_edges(g, matrix(c(1, 2, 1, 3, 1, 4), nrow = 2)) . <- add_edges(g, matrix(1:4, nrow = 1)) diff --git a/tests/testthat/test-make.R b/tests/testthat/test-make.R index d00ce43c7d..cd449d8402 100644 --- a/tests/testthat/test-make.R +++ b/tests/testthat/test-make.R @@ -36,7 +36,7 @@ test_that("make_graph() warns for 2xn and 2x2 matrices and reads them by column test_that("make_graph() warning for legacy matrices", { rlang::local_options(lifecycle_verbosity = "warning") - expect_snapshot(. <- make_graph(t(cbind(1, 2:4)))) + expect_snapshot_igraph(. <- make_graph(t(cbind(1, 2:4)))) }) test_that("make_ works with n parameter", { diff --git a/tests/testthat/test-migration-fixture.R b/tests/testthat/test-migration-fixture.R index 14effc7f55..1b9ab8346a 100644 --- a/tests/testthat/test-migration-fixture.R +++ b/tests/testthat/test-migration-fixture.R @@ -661,7 +661,9 @@ test_that("an old head name followed by a positional value keeps the old order", test_that("positional old tail arguments are recovered on the same path", { rlang::local_options(lifecycle_verbosity = "warning") - expect_snapshot(res <- migration_fixture_rename("g", from = 1, 2, "in", TRUE)) + expect_snapshot_igraph( + res <- migration_fixture_rename("g", from = 1, 2, "in", TRUE) + ) expect_equal( res, list(graph = "g", vertices = 1, to = 2, type = "in", directed = TRUE) diff --git a/tests/testthat/test-structural-properties.R b/tests/testthat/test-structural-properties.R index 4b7a28bd9c..9995c056a9 100644 --- a/tests/testthat/test-structural-properties.R +++ b/tests/testthat/test-structural-properties.R @@ -1601,7 +1601,7 @@ test_that("knn() tail arguments and legacy positional recovery", { test_that("degree(v = ) is deprecated but still works", { rlang::local_options(lifecycle_verbosity = "warning") g <- make_ring(10) - expect_snapshot( + expect_snapshot_igraph( res_legacy <- degree(g, v = 1:3) ) expect_identical(res_legacy, degree(g, vertices = 1:3))