diff --git a/tests/testthat/_snaps/serialize.md b/tests/testthat/_snaps/serialize.md new file mode 100644 index 00000000000..c757d5ffa50 --- /dev/null +++ b/tests/testthat/_snaps/serialize.md @@ -0,0 +1,17 @@ +# serialization works + + Code + g + Output + IGRAPH D--- 3 3 -- Ring graph + + attr: name (g/c), mutual (g/l), circular (g/l) + + edges: + [1] 1->2 2->3 3->1 + Code + gs + Output + IGRAPH D--- 3 3 -- Ring graph + + attr: name (g/c), mutual (g/l), circular (g/l) + + edges: + [1] 1->2 2->3 3->1 + diff --git a/tests/testthat/test-serialize.R b/tests/testthat/test-serialize.R index d2009965f70..c42d393c957 100644 --- a/tests/testthat/test-serialize.R +++ b/tests/testthat/test-serialize.R @@ -1,8 +1,13 @@ test_that("serialization works", { - local_igraph_options(print.id = FALSE) + local_igraph_options(print.id = FALSE, print.full = TRUE) g <- make_ring(3, directed = TRUE) gs <- unserialize(serialize(g, NULL)) expect_identical(unclass(g)[-igraph_t_idx_env], unclass(gs)[-igraph_t_idx_env]) + + expect_snapshot({ + g + gs + }) })