tests/testthat/test-distinct.R

test_that("distinct works", {
  gr <- create_notable('bull') %>%
    mutate(id = c(1,1,1,2,2)) %>%
    activate(edges) %>%
    mutate(id = c(1,1,2,2,3))
  gr1 <- gr %>% activate(nodes) %>% distinct()
  expect_equal(igraph::gorder(gr1), 2)
  gr2 <- gr %>% activate(edges) %>% distinct(id)
  expect_equal(igraph::gsize(gr2), 3)
})

test_empty_context()

Try the tidygraph package in your browser

Any scripts or data that you put into this service are public.

tidygraph documentation built on June 22, 2024, 11:32 a.m.