From d3614e42c50b0dad21c2946ea7cf567c4b97bf37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:02:23 +0200 Subject: [PATCH 01/19] test: fix argument in expectations --- tests/testthat/test-random_walk.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-random_walk.R b/tests/testthat/test-random_walk.R index 015babffceb..9e8b7fdc64b 100644 --- a/tests/testthat/test-random_walk.R +++ b/tests/testthat/test-random_walk.R @@ -16,8 +16,8 @@ test_that("directed random_walk works", { expect_equal(w2, c(4:1, 10:9)) w3 <- as_ids(random_walk(g, start = 1, steps = 5, mode = "all")) - expect_length(w, 6) - expect_true(all(abs(diff(as.numeric(w))) %in% c(1, 9))) + expect_length(w3, 6) + expect_true(all(abs(diff(as.numeric(w3))) %in% c(1, 9))) }) test_that("directed random_walk can return wtih an error when stuck", { From 0829a52893d5a5c4f9d643d4387da908ae164c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:02:40 +0200 Subject: [PATCH 02/19] test: no need to define object that is returned directly --- tests/testthat/test-structural-properties.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-structural-properties.R b/tests/testthat/test-structural-properties.R index 5d7d39d68d5..c7b5d183473 100644 --- a/tests/testthat/test-structural-properties.R +++ b/tests/testthat/test-structural-properties.R @@ -590,7 +590,7 @@ test_that("ego() works", { neig <- function(graph, order, vertices) { sp <- distances(graph) v <- unique(unlist(lapply(vertices, function(x) { - w <- which(sp[x, ] <= order) + which(sp[x, ] <= order) }))) induced_subgraph(graph, c(v, vertices)) } @@ -607,7 +607,7 @@ test_that("ego() works", { nei <- function(graph, order, vertices) { sp <- distances(graph) v <- unique(unlist(lapply(vertices, function(x) { - w <- which(sp[x, ] <= order) + which(sp[x, ] <= order) }))) v } From 8c33b3086c0c31e36c76d7d18561dcdd8a9c4443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:02:51 +0200 Subject: [PATCH 03/19] test: suppression comment for Jarl --- tests/testthat/test-weakref.R | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testthat/test-weakref.R b/tests/testthat/test-weakref.R index 7b1bc0ec785..8d4da9b23b2 100644 --- a/tests/testthat/test-weakref.R +++ b/tests/testthat/test-weakref.R @@ -27,6 +27,7 @@ test_that("weak reference finalizer is called", { value <- "foobar" hello <- "" fin <- function(env) hello <<- "world" + # jarl-ignore unused_object: test design vs <- make_weak_ref(key = g, value = value, finalizer = fin) rm(g) From a481fe3a30ca158e8985401d63f8b1fb89b544c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:13:54 +0200 Subject: [PATCH 04/19] test: simplify --- tests/testthat/test-palette.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-palette.R b/tests/testthat/test-palette.R index 1f927ed0599..43b8510bb9b 100644 --- a/tests/testthat/test-palette.R +++ b/tests/testthat/test-palette.R @@ -127,7 +127,7 @@ test_that("r_pal() works correctly", { test_that("r_pal() handles edge cases", { # Warning for too many colors (note: message says "divergent" - this might be a bug!) expect_warning( - result <- r_pal(15), + r_pal(15), "Cannot make 15 divergent colors" # This warning message seems wrong ) From 7d323a1fca07734fc4ad5ea96c40b5d09fddb3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:14:40 +0200 Subject: [PATCH 05/19] test: rm unused object --- tests/testthat/test-make.R | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/testthat/test-make.R b/tests/testthat/test-make.R index 245ee149e93..a13bc256af2 100644 --- a/tests/testthat/test-make.R +++ b/tests/testthat/test-make.R @@ -367,7 +367,6 @@ test_that("make_de_bruijn_graph works", { test_that("make_bipartite_graph works", { inc_mat_rand <- matrix(sample(0:1, 35, replace = TRUE, prob = c(3, 1)), ncol = 5) - bip_from_inc <- graph_from_biadjacency_matrix(inc_mat_rand) edges <- unlist(sapply(seq_len(nrow(inc_mat_rand)), function(x) { w <- which(inc_mat_rand[x, ] != 0) + nrow(inc_mat_rand) From 2ee1dc1873f022883a6bbe107dd9335e3e398a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:15:19 +0200 Subject: [PATCH 06/19] test: rm unused object --- tests/testthat/test-layout.R | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/testthat/test-layout.R b/tests/testthat/test-layout.R index 49dcdf57131..d09d6bf2055 100644 --- a/tests/testthat/test-layout.R +++ b/tests/testthat/test-layout.R @@ -307,7 +307,6 @@ test_that("parameters are evaluated early", { cc <- 5 spec <- as_star(center = cc) - cc <- 10 l2 <- layout_(g, spec) expect_identical(l1, l2) }) From cf31dbdd4961e6a3bfdddcd46a464fe81b38eba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:16:13 +0200 Subject: [PATCH 07/19] test: exception --- tests/testthat/test-iterators.R | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testthat/test-iterators.R b/tests/testthat/test-iterators.R index a65fcf1b56f..995d24ae272 100644 --- a/tests/testthat/test-iterators.R +++ b/tests/testthat/test-iterators.R @@ -243,6 +243,7 @@ test_that("vs/es refers to the original graph", { vs <- V(ring1) es <- E(ring1) + # jarl-ignore unused_object: test design ring1 <- ring1 + 4 expect_identical(get_vs_graph(vs), ring2) From 6948e90a07b7a9639df0a2bcc80cd26c3ae89a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:16:37 +0200 Subject: [PATCH 08/19] test: rm unused object --- tests/testthat/test-indexing.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/testthat/test-indexing.R b/tests/testthat/test-indexing.R index 6538a7e2ab5..7aa9598f3c5 100644 --- a/tests/testthat/test-indexing.R +++ b/tests/testthat/test-indexing.R @@ -310,8 +310,6 @@ test_that("[[ queries edges with vertex names", { ) }) test_that("[ handles from and to properly", { - g <- make_test_named_tree() - g <- make_tree(20) expect_equal(g[from = c(1, 2, 2, 3), to = c(3, 4, 8, 7)], c(1, 1, 0, 1)) From b0faba3f46c4b3d29346c96f7887384bea694bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:19:35 +0200 Subject: [PATCH 09/19] test: simplify --- tests/testthat/_snaps/incidence.md | 6 +++--- tests/testthat/test-incidence.R | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/testthat/_snaps/incidence.md b/tests/testthat/_snaps/incidence.md index dbb1ba9a91e..9e0c14767e2 100644 --- a/tests/testthat/_snaps/incidence.md +++ b/tests/testthat/_snaps/incidence.md @@ -61,7 +61,7 @@ # graph_from_biadjacency_matrix() errors well Code - (g <- graph_from_biadjacency_matrix(inc, weight = FALSE)) + (graph_from_biadjacency_matrix(inc, weight = FALSE)) Condition Error in `graph_from_biadjacency_matrix()`: ! `weighted` can't be `FALSE`. @@ -70,7 +70,7 @@ --- Code - (g <- graph_from_biadjacency_matrix(inc, weight = 42)) + (graph_from_biadjacency_matrix(inc, weight = 42)) Condition Error in `graph_from_biadjacency_matrix()`: ! `weighted` can't be a number. @@ -79,7 +79,7 @@ --- Code - (g <- graph_from_biadjacency_matrix(inc, multiple = TRUE, weighted = TRUE)) + (graph_from_biadjacency_matrix(inc, multiple = TRUE, weighted = TRUE)) Condition Error in `graph_from_biadjacency_matrix()`: ! `multiple` and `weighted` cannot be both `TRUE`. diff --git a/tests/testthat/test-incidence.R b/tests/testthat/test-incidence.R index dafb54fc1b9..bdaa29ec33f 100644 --- a/tests/testthat/test-incidence.R +++ b/tests/testthat/test-incidence.R @@ -209,13 +209,13 @@ test_that("graph_from_biadjacency_matrix() errors well", { rownames(inc) <- LETTERS[1:3] expect_snapshot_igraph_error({ - (g <- graph_from_biadjacency_matrix(inc, weight = FALSE)) + (graph_from_biadjacency_matrix(inc, weight = FALSE)) }) expect_snapshot_igraph_error({ - (g <- graph_from_biadjacency_matrix(inc, weight = 42)) + (graph_from_biadjacency_matrix(inc, weight = 42)) }) expect_snapshot_igraph_error({ - (g <- graph_from_biadjacency_matrix(inc, multiple = TRUE, weighted = TRUE)) + (graph_from_biadjacency_matrix(inc, multiple = TRUE, weighted = TRUE)) }) }) From b87bfeb7f9776dbd0b7fcdd2c97ac18a09defa85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 29 Jun 2026 15:20:08 +0200 Subject: [PATCH 10/19] test: rm unused objects --- tests/testthat/test-glet.R | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/testthat/test-glet.R b/tests/testthat/test-glet.R index dacef1c0626..2d1e0d00a25 100644 --- a/tests/testthat/test-glet.R +++ b/tests/testthat/test-glet.R @@ -50,7 +50,6 @@ test_that("Graphlets filtering works", { }) threshold.net <- function(graph, level) { - N <- vcount(graph) graph.t <- delete_edges(graph, which(E(graph)$weight < level)) clqt <- unvs(max_cliques(graph.t)) From 08c5e1f8ade2839d7dff938e892220a5adb42e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 3 Jul 2026 14:56:32 +0200 Subject: [PATCH 11/19] test: rm unused object from test-foreign --- tests/testthat/_snaps/foreign.md | 11 +++-------- tests/testthat/test-foreign.R | 8 ++++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/testthat/_snaps/foreign.md b/tests/testthat/_snaps/foreign.md index 5ff13f89152..412dbd28ffe 100644 --- a/tests/testthat/_snaps/foreign.md +++ b/tests/testthat/_snaps/foreign.md @@ -45,12 +45,7 @@ # graph_from_graphdb works Code - g <- graph_from_graphdb(nodes = 1000) - ---- - - Code - g <- graph_from_graphdb() + graph_from_graphdb() Condition Error in `graph_from_graphdb()`: ! Either `nodes`' or ``url`' must be non-null. @@ -58,7 +53,7 @@ --- Code - g <- graph_from_graphdb(nodes = 10, prefix = "not_existing") + graph_from_graphdb(nodes = 10, prefix = "not_existing") Condition Error in `graph_from_graphdb()`: ! not_existing is not a valid prefix. @@ -67,7 +62,7 @@ --- Code - g <- graph_from_graphdb(nodes = 10, type = "not_existing") + graph_from_graphdb(nodes = 10, type = "not_existing") Condition Error in `graph_from_graphdb()`: ! not_existing is not a valid graph type. diff --git a/tests/testthat/test-foreign.R b/tests/testthat/test-foreign.R index b1542f0334f..d15d9de395c 100644 --- a/tests/testthat/test-foreign.R +++ b/tests/testthat/test-foreign.R @@ -66,12 +66,12 @@ test_that("graph_from_graphdb works", { # docker run --rm -ti -v $PWD:/rigraph -e MAKEFLAGS=-j4 ghcr.io/cynkra/docker-images/rigraph-san:latest RDcsan -q -e 'filename <- "/rigraph/DESCRIPTION"; gz_file_con <- file(filename, open = "rb"); file_con <- gzcon(gz_file_con); close(file_con); gc()' skip_if(Sys.getenv("R_SANITIZER") == "true") - expect_snapshot(g <- graph_from_graphdb(nodes = 1000)) - expect_snapshot_igraph_error(g <- graph_from_graphdb()) + expect_silent(graph_from_graphdb(nodes = 1000)) + expect_snapshot_igraph_error(graph_from_graphdb()) expect_snapshot_igraph_error( - g <- graph_from_graphdb(nodes = 10, prefix = "not_existing") + graph_from_graphdb(nodes = 10, prefix = "not_existing") ) expect_snapshot_igraph_error( - g <- graph_from_graphdb(nodes = 10, type = "not_existing") + graph_from_graphdb(nodes = 10, type = "not_existing") ) }) From 74c944bb94d61d7904295bff9d06779be0955b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 3 Jul 2026 14:58:18 +0200 Subject: [PATCH 12/19] test: fix expectation --- tests/testthat/test-cycles.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-cycles.R b/tests/testthat/test-cycles.R index cfb0b6c3539..c378f54ff95 100644 --- a/tests/testthat/test-cycles.R +++ b/tests/testthat/test-cycles.R @@ -27,7 +27,10 @@ test_that("simple_cycle() works directed", { }) test_that("simple_cycle() works undirected", { - g <- graph_from_literal(A -+ B -+ C -+ A -+ D -+ E +- F -+ A, E -+ E, A -+ F, simplify = FALSE) + g <- graph_from_literal( + A -+ B -+ C -+ A -+ D -+ E +- F -+ A, E -+ E, A -+ F, + simplify = FALSE + ) all_simple_cycles <- simple_cycles(g, mode = "all") expect_length(all_simple_cycles$vertices, 5) expect_length(all_simple_cycles$edges, 5) @@ -40,8 +43,8 @@ test_that("simple_cycle() works undirected", { expect_equal(as.numeric(all_simple_cycles$vertices[[2]]), c(1, 4, 5, 6)) all_simple_cycles_23 <- simple_cycles(g, mode = "all", min = 2, max = 3) - expect_length(all_simple_cycles$vertices, 5) - expect_length(all_simple_cycles$edges, 5) + expect_length(all_simple_cycles_23$vertices, 2) + expect_length(all_simple_cycles_23$edges, 2) }) # Tests for callback function From a734811ad4ad1389ebf6e48c2601441365d82fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 3 Jul 2026 15:00:34 +0200 Subject: [PATCH 13/19] test: fix expectation --- tests/testthat/test-conversion.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-conversion.R b/tests/testthat/test-conversion.R index 9d732b09436..c51ecbe8c96 100644 --- a/tests/testthat/test-conversion.R +++ b/tests/testthat/test-conversion.R @@ -701,7 +701,7 @@ test_that("graphNEL conversion works", { A <- as_adjacency_matrix(g, weights = "weight", sparse = FALSE) A2 <- as_adjacency_matrix(g2, weights = "weight", sparse = FALSE) - expect_equal(A, A) + expect_equal(A, A2) expect_equal(g$name, g2$name) }) From f0fba10996e9a92085c0952d5ab7db9c631b8f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 3 Jul 2026 15:02:12 +0200 Subject: [PATCH 14/19] test: rm unused object --- tests/testthat/_snaps/community.md | 2 +- tests/testthat/test-community.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/_snaps/community.md b/tests/testthat/_snaps/community.md index 757b8b0be73..244b09a133d 100644 --- a/tests/testthat/_snaps/community.md +++ b/tests/testthat/_snaps/community.md @@ -1,7 +1,7 @@ # modularity_matrix no longer accepts a membership argument for compatibility Code - x <- modularity_matrix(karate, membership = rep(1, vcount(karate))) + modularity_matrix(karate, membership = rep(1, vcount(karate))) Condition Error: ! The `membership` argument of `modularity_matrix()` is no longer used as of igraph 2.1.0. diff --git a/tests/testthat/test-community.R b/tests/testthat/test-community.R index 389d1d3801e..63d8867cbf5 100644 --- a/tests/testthat/test-community.R +++ b/tests/testthat/test-community.R @@ -474,7 +474,7 @@ test_that("modularity_matrix works", { test_that("modularity_matrix no longer accepts a membership argument for compatibility", { karate <- make_graph("zachary") expect_snapshot(error = TRUE, { - x <- modularity_matrix(karate, membership = rep(1, vcount(karate))) + modularity_matrix(karate, membership = rep(1, vcount(karate))) }) }) From f319b2cf91244f6dea84ab591567610e2912a4cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 3 Jul 2026 15:05:54 +0200 Subject: [PATCH 15/19] test: rm unused object --- tests/testthat/test-community.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-community.R b/tests/testthat/test-community.R index 63d8867cbf5..973124a1879 100644 --- a/tests/testthat/test-community.R +++ b/tests/testthat/test-community.R @@ -284,7 +284,7 @@ test_that("cluster_leading_eigen works", { A <- as_adjacency_matrix(karate, sparse = FALSE) ec <- ecount(karate) deg <- degree(karate) - karate_lc2 <- cluster_leading_eigen(karate, callback = mod_mat_caller) + cluster_leading_eigen(karate, callback = mod_mat_caller) }) test_that("cluster_leading_eigen is deterministic", { From 94f95bc03d3f6b5900a1f2e9a2ff98bc40983d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 3 Jul 2026 15:11:55 +0200 Subject: [PATCH 16/19] test: rm unused object --- tests/testthat/test-community.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-community.R b/tests/testthat/test-community.R index 973124a1879..5743ac7570e 100644 --- a/tests/testthat/test-community.R +++ b/tests/testthat/test-community.R @@ -223,7 +223,7 @@ test_that("cluster_leading_eigen works", { multiplier(v) }) ev <- eigen(M) - ret <- 0 + expect_equal(ev$values[1], value) if (sign(ev$vectors[1, 1]) != sign(vector[1])) { ev$vectors <- -ev$vectors From 3f2cfedbffb4867e9cfd80fa1e842aa2c19473c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 3 Jul 2026 15:14:05 +0200 Subject: [PATCH 17/19] test: rm unused object, make expectation more specific --- tests/testthat/test-centrality.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-centrality.R b/tests/testthat/test-centrality.R index 7529da33376..39c5fc564b4 100644 --- a/tests/testthat/test-centrality.R +++ b/tests/testthat/test-centrality.R @@ -776,11 +776,12 @@ test_that("spectrum() works for symmetric matrices", { rlang::local_options(lifecycle_verbosity = "warning") expect_warning( - e3 <- spectrum( + spectrum( g, which = list(howmany = 4, pos = "SA"), options = arpack_defaults - ) + ), + "must be a list" ) }) From 77c1af95cbd753cdb301aee207af5508243b7c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 3 Jul 2026 15:14:57 +0200 Subject: [PATCH 18/19] test: fix expectation --- tests/testthat/test-centrality.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-centrality.R b/tests/testthat/test-centrality.R index 39c5fc564b4..b784c599d28 100644 --- a/tests/testthat/test-centrality.R +++ b/tests/testthat/test-centrality.R @@ -745,7 +745,7 @@ test_that("undirected alpha_centrality() works, #653", { expect_equal(ac1, ac2) g2 <- as_directed(g, mode = "mutual") - ac3 <- alpha_centrality(g, sparse = FALSE) + ac3 <- alpha_centrality(g2, sparse = FALSE) expect_equal(ac1, ac3) }) From a221b9dd6aff7a6a6ae3e4f506cdebf08dd69b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 3 Jul 2026 15:16:05 +0200 Subject: [PATCH 19/19] test: add exception --- tests/testthat/test-attributes.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-attributes.R b/tests/testthat/test-attributes.R index 9b2bd83021b..a99216e889c 100644 --- a/tests/testthat/test-attributes.R +++ b/tests/testthat/test-attributes.R @@ -11,14 +11,17 @@ test_that("bracketing works (not changing attribute of similar graphs)", { g <- make_graph(c(1, 2, 1, 3, 3, 4)) g <- set_vertex_attr(g, name = "weight", value = 1:vcount(g)) + # jarl-ignore unused_object: test design graph2 <- set_vertex_attr(g, name = "weight", value = rep(1, vcount(g))) expect_equal(vertex_attr(g, name = "weight"), 1:4) g <- set_edge_attr(g, name = "weight", value = 1:ecount(g)) + # jarl-ignore unused_object: test design graph2 <- set_edge_attr(g, name = "weight", value = rep(1, ecount(g))) expect_equal(edge_attr(g, name = "weight"), 1:3) g <- set_graph_attr(g, name = "name", "foo") + # jarl-ignore unused_object: test design graph2 <- set_graph_attr(g, name = "name", "foobar") expect_equal(graph_attr(g, name = "name"), "foo") }) @@ -33,10 +36,12 @@ test_that("bracketing works with a function (not changing attribute of similar g copy_test <- function(g) { graph2 <- set_vertex_attr(g, name = "weight", value = rep(1, vcount(g))) - graph2 <- set_edge_attr(g, name = "weight", value = rep(1, ecount(g))) - graph2 <- set_graph_attr(g, name = "name", "foobar") + graph2 <- set_edge_attr(graph2, name = "weight", value = rep(1, ecount(g))) + graph2 <- set_graph_attr(graph2, name = "name", "foobar") + graph2 } + # jarl-ignore unused_object: test design g2 <- copy_test(g) expect_equal(vertex_attr(g, name = "weight"), 1:4) expect_equal(edge_attr(g, name = "weight"), 1:3) @@ -56,6 +61,7 @@ test_that("bracketing works with shortcuts (not changing attribute of similar gr graph$name <- "foobar" } + # jarl-ignore unused_object: test design g_copy <- copy_test(g) expect_equal(vertex_attr(g, name = "weight"), 1:4) expect_equal(edge_attr(g, name = "weight"), 1:3)