tests/testthat/test-deprecated_indexing_functions.R

test_that("deprecated indexing functions are indeed deprecated", {
  g <- make_ring(10)

  expect_error(V(g)[nei(1)], "was deprecated")
  expect_error(V(g)[innei(1)], "was deprecated")
  expect_error(V(g)[outnei(1)], "was deprecated")
  expect_error(V(g)[inc(1)], "was deprecated")
  expect_error(V(g)[adj(1)], "was deprecated")
  expect_error(V(g)[from(1)], "was deprecated")
  expect_error(V(g)[to(1)], "was deprecated")

  expect_error(E(g)[adj(1)], "was deprecated")
  expect_error(E(g)[inc(1)], "was deprecated")
  expect_error(E(g)[from(1)], "was deprecated")
  expect_error(E(g)[to(1)], "was deprecated")
})
igraph/rigraph documentation built on June 28, 2024, 7:13 a.m.