tests/testthat/test-edgeModify2.R

print("This is the beginning of test-edgeModify2")

test_that("only accept proper input", {
  expect_error(edgeModify2(bandwidth = 2, edge = 1:4),
               "edge must be a square matrix")
  expect_error(edgeModify2(bandwidth = 2, edge = matrix(1.2, 4, 4), plot = FALSE),
               "edge can only have entry equal to 0 or 1")
  expect_error(edgeModify2(bandwidth = -1, edge = matrix(1, 4, 4)),
               "bandwidth must be a positive integer")
  stepedge <- stepEdge(image = sar, bandwidth = 10, thresh = 17, degree = 1)
  expect_no_error(edgeModify2(bandwidth = 10, edge = stepedge, plot = FALSE))
  expect_no_error(edgeModify2(bandwidth = 10, edge = stepedge, plot = TRUE))
})

print("This is the end of test-edgeModify2")

Try the DRIP package in your browser

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

DRIP documentation built on Jan. 15, 2026, 5:06 p.m.