test_that("graph measures returns scalars", { gr <- create_notable('housex') %>% mutate(type = c(1, 1, 1, 2, 2)) .graph_context$set(gr) expect_length(graph_adhesion(), 1) expect_length(graph_assortativity(type), 1) expect_length(graph_automorphisms(), 1) expect_length(graph_clique_count(), 1) expect_length(graph_clique_num(), 1) expect_length(graph_component_count(), 1) expect_length(graph_diameter(), 1) expect_length(graph_girth(), 1) expect_length(graph_mean_dist(), 1) expect_length(graph_min_cut(), 1) expect_length(graph_motif_count(), 1) expect_length(graph_order(), 1) expect_length(graph_radius(), 1) expect_length(graph_reciprocity(), 1) expect_length(graph_size(), 1) expect_length(graph_modularity(type), 1) expect_length(graph_efficiency(), 1) .graph_context$clear() gr <- create_ring(5, TRUE) %>% mutate(type = c(1, 1, 1, 2, 2)) .graph_context$set(gr) expect_length(graph_asym_count(), 1) expect_length(graph_mutual_count(), 1) expect_length(graph_unconn_count(), 1) .graph_context$clear() }) test_empty_context()