@@ -142,10 +142,10 @@ test_that("as_adjacency_matrix() works -- sparse + not both", {
142142
143143test_that(" as_adjacency_matrix() errors well -- sparse" , {
144144 g <- make_graph(c(1 , 2 , 2 , 1 , 2 , 2 , 3 , 3 , 3 , 3 , 3 , 4 , 4 , 2 , 4 , 2 , 4 , 2 ), directed = TRUE )
145- expect_snapshot (as_adjacency_matrix(g , attr = " bla" ), error = TRUE )
145+ expect_snapshot_igraph_error (as_adjacency_matrix(g , attr = " bla" ))
146146
147147 E(g )$ bla <- letters [1 : ecount(g )]
148- expect_snapshot (as_adjacency_matrix(g , attr = " bla" ), error = TRUE )
148+ expect_snapshot_igraph_error (as_adjacency_matrix(g , attr = " bla" ))
149149})
150150
151151test_that(" as_adjacency_matrix() works -- sparse undirected" , {
@@ -197,15 +197,13 @@ test_that("as_adjacency_matrix() works -- dense", {
197197
198198test_that(" as_adjacency_matrix() errors well -- dense" , {
199199 g <- make_graph(c(1 , 2 , 2 , 1 , 2 , 2 , 3 , 3 , 3 , 3 , 3 , 4 , 4 , 2 , 4 , 2 , 4 , 2 ), directed = TRUE )
200- expect_snapshot(
201- as_adjacency_matrix(g , attr = " bla" , sparse = FALSE ),
202- error = TRUE
200+ expect_snapshot_igraph_error(
201+ as_adjacency_matrix(g , attr = " bla" , sparse = FALSE )
203202 )
204203
205204 E(g )$ bla <- letters [1 : ecount(g )]
206- expect_snapshot(
207- as_adjacency_matrix(g , attr = " bla" , sparse = FALSE ),
208- error = TRUE
205+ expect_snapshot_igraph_error(
206+ as_adjacency_matrix(g , attr = " bla" , sparse = FALSE )
209207 )
210208})
211209
@@ -679,7 +677,7 @@ test_that("edge names work", {
679677
680678test_that(" graph_from_edgelist errors for NAs" , {
681679 A <- matrix (c(1 , 2 , NA , 1 ), 2 , 2 )
682- expect_snapshot (graph_from_edgelist(A ), error = TRUE )
680+ expect_snapshot_igraph_error (graph_from_edgelist(A ))
683681})
684682
685683test_that(" graph_from_data_frame works with factors" , {
0 commit comments