tests/testthat/test-defunct.R

test_that("defunct gs* functions error via .Defunct()", {
  expect_error(gsMPG(), class = "defunctError")
  expect_error(gsGOC(), class = "defunctError")
  expect_error(gsGOCCorridor(), class = "defunctError")
  expect_error(gsGOCDistance(), class = "defunctError")
  expect_error(gsGOCPoint(), class = "defunctError")
  expect_error(gsGOCVisualize(), class = "defunctError")
  expect_error(gsGraphDataFrame(), class = "defunctError")
  expect_error(gsMPGstitch(), class = "defunctError")
})

test_that("defunct functions point to their replacement", {
  expect_error(gsMPG(), "MPG")
  expect_error(gsGOC(), "GOC")
  expect_error(gsGOCCorridor(), "corridor")
  expect_error(gsGOCDistance(), "distance")
  expect_error(gsGOCPoint(), "point")
  expect_error(gsGOCVisualize(), "grain")
  expect_error(gsGraphDataFrame(), "graphdf")
})

Try the grainscape package in your browser

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

grainscape documentation built on July 8, 2026, 1:08 a.m.