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/3] 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 0ac441ef2eb9d71a27b247a2ecc9463e0cb67ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Mon, 22 May 2023 07:18:48 +0200 Subject: [PATCH 2/3] Check print.full option in snapshot tests --- tests/testthat/_snaps/serialize.md | 4 ++++ tests/testthat/test-serialize.R | 1 + 2 files changed, 5 insertions(+) diff --git a/tests/testthat/_snaps/serialize.md b/tests/testthat/_snaps/serialize.md index c757d5ffa50..6ac7bc16668 100644 --- a/tests/testthat/_snaps/serialize.md +++ b/tests/testthat/_snaps/serialize.md @@ -1,5 +1,9 @@ # serialization works + Code + igraph_opt("print.full") + Output + [1] "auto" Code g Output diff --git a/tests/testthat/test-serialize.R b/tests/testthat/test-serialize.R index 099ab76e3d8..dd959c22bec 100644 --- a/tests/testthat/test-serialize.R +++ b/tests/testthat/test-serialize.R @@ -7,6 +7,7 @@ test_that("serialization works", { expect_identical(unclass(g)[-igraph_t_idx_env], unclass(gs)[-igraph_t_idx_env]) expect_snapshot({ + igraph_opt("print.full") g gs }) From 77da69a2c59df1b3796125f7002eadc3f0d67e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 28 May 2023 09:21:41 +0200 Subject: [PATCH 3/3] Don't observe --- tests/testthat/_snaps/serialize.md | 4 ---- tests/testthat/test-serialize.R | 1 - 2 files changed, 5 deletions(-) diff --git a/tests/testthat/_snaps/serialize.md b/tests/testthat/_snaps/serialize.md index 6ac7bc16668..c757d5ffa50 100644 --- a/tests/testthat/_snaps/serialize.md +++ b/tests/testthat/_snaps/serialize.md @@ -1,9 +1,5 @@ # serialization works - Code - igraph_opt("print.full") - Output - [1] "auto" Code g Output diff --git a/tests/testthat/test-serialize.R b/tests/testthat/test-serialize.R index dd959c22bec..099ab76e3d8 100644 --- a/tests/testthat/test-serialize.R +++ b/tests/testthat/test-serialize.R @@ -7,7 +7,6 @@ test_that("serialization works", { expect_identical(unclass(g)[-igraph_t_idx_env], unclass(gs)[-igraph_t_idx_env]) expect_snapshot({ - igraph_opt("print.full") g gs })