tests/testthat/test-mutate.R

test_that("mutate works with nodes", {
  mut <- create_notable('bull') %>%
    mutate(letters = letters[1:5]) %>%
    pull(letters)
  expect_equal(mut, letters[1:5])
})
test_that("mutate works with edges", {
  mut <- create_notable('bull') %>%
    activate(edges) %>%
    mutate(letters = letters[1:5]) %>%
    pull(letters)
  expect_equal(mut, letters[1:5])
})

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.