tests/testthat/test-metrics_template.R

las = random_10_points

VCI = function() { 0 }
colorize_points = function() { 0 }
f = function()
{
  entropy <- function(x) x
  cloud_metrics(las, ~entropy(Z))
}


test_that("Ambiguous definitions are handled", {

  expect_error(cloud_metrics(las, ~VCI()), "exists in the package lidR but is also defined in")
  expect_error(cloud_metrics(las, ~colorize_points()), "exists in the package lidR but is also defined in")
  expect_error(f(), "exists in the package lidR but is also defined in")
  #expect_error(cloud_metrics(las, ~lidR::VCI(Z, 10)))
})

Try the lidR package in your browser

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

lidR documentation built on Sept. 8, 2023, 5:10 p.m.