mutate(unicorn = rep(c("yes", "no"), 4))
test_that("to_ and from_ subgraphs works", {
mutate(wave = sample(1995:1998, 10, replace = TRUE))
expect_length(to_waves(wave, panels = c(1995, 1996)), 2)
test_that("to_waves works for diff_model objects", {
mutate_ties(time = 1:10, increment = 1) %>%
add_ties(c(1,2), list(time = 3, increment = -1))
test_that("to_ and from_ slices works", {
expect_length(to_slices(slice, slice = 7), length(ison_adolescents))
expect_true(length(igraph::edge_attr(to_slices(slice, slice = 7), "weight"))
expect_length(to_slices(slice, slice = c(5, 7)), 2)
expect_s3_class(to_slices(slice, slice = 7), "tbl_graph")

test_that("matrix projected correctly by rows",{
expect_false(tie_weights(to_mode1(ison_southern_women, "rand"))[3] == tie_weights(to_mode1(ison_southern_women, "count"))[3])
test_that("matrix projected correctly by columns",{
expect_false(tie_weights(to_mode2(ison_southern_women, "rand"))[1] == tie_weights(to_mode2(ison_southern_women, "count"))[1])
expect_equal(c(net_nodes(to_subgraph(ison_lawfirm, office == "Boston"))), 48)
waves <- to_waves(orig, attribute = "wave")
expect_error(to_eulerian(ison_koenigsberg), "This is not a Eulerian graph.")

mutate_ties(type = sample(c("friend", "enemy"), 10, replace = TRUE),

test_that("additional node mark functions work", {
c("TRUE", "FALSE", "FALSE", "FALSE", "TRUE", "TRUE", "FALSE", "TRUE"))
c("FALSE", "FALSE", "TRUE", "TRUE", "FALSE", "FALSE", "FALSE",
expect_equal(as.character(node_is_fold(create_explicit(A-B, B-C, A-C, C-D, C-E, D-E))),
c("FALSE", "FALSE", "TRUE", "FALSE", "FALSE"))
c("FALSE", "TRUE", "TRUE", "FALSE", "FALSE", "FALSE", "FALSE", "FALSE"))
expect_equal(as.character(node_is_latent(play_diffusion(create_tree(6), latency = 1), time = 1)),
c("FALSE", "TRUE",  "TRUE",  "FALSE", "FALSE", "FALSE"))
c("TRUE", "TRUE",  "TRUE",  "FALSE", "FALSE", "FALSE"))
expect_equal(as.character(node_is_recovered(play_diffusion(create_tree(6), recovery = 0.5), time = 3)),
c("FALSE", "TRUE",  "FALSE",  "FALSE", "FALSE", "TRUE"))
c("FALSE", "FALSE",  "FALSE",  "TRUE", "FALSE", "FALSE", "FALSE", "FALSE"))
test_that("node infection, exposure, and recovery works", {
.data <- play_diffusion(generate_random(to_undirected(to_unnamed(ison_networkers)), with_attr = FALSE),
seeds = 10, latency = 0.25, recovery = 0.2, steps = 10)