From 342586e4728dd0ef04246053abcd0f69177fe5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 21 May 2023 21:26:39 +0200 Subject: [PATCH 1/2] Re-add failing test This reverts commit 84fb5143c5e7a14af929985a2697b7363ecc31e4. --- tests/testthat/_snaps/serialize.md | 17 +++++++++++++++++ tests/testthat/test-serialize.R | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 tests/testthat/_snaps/serialize.md 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..099ab76e3d8 100644 --- a/tests/testthat/test-serialize.R +++ b/tests/testthat/test-serialize.R @@ -5,4 +5,9 @@ test_that("serialization works", { gs <- unserialize(serialize(g, NULL)) expect_identical(unclass(g)[-igraph_t_idx_env], unclass(gs)[-igraph_t_idx_env]) + + expect_snapshot({ + g + gs + }) }) From 1740fdf1a898b320e90f144f41a80bcaac55f3fb Mon Sep 17 00:00:00 2001 From: Antonov548 Date: Mon, 22 May 2023 00:00:05 +0200 Subject: [PATCH 2/2] define `print.full` TRUE --- tests/testthat/test-serialize.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-serialize.R b/tests/testthat/test-serialize.R index 099ab76e3d8..c42d393c957 100644 --- a/tests/testthat/test-serialize.R +++ b/tests/testthat/test-serialize.R @@ -1,5 +1,5 @@ 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))