tests/testthat/test-is.functions.R

data("dmj_nh")
data("dmj_h")

test_defol <- defoliate_trees(dmj_h, dmj_nh)
test_obr <- outbreak(test_defol)

test_that("defol objects are classed correctly", {
  expect_true(is.defol(test_defol))
})

test_that("non-defol objects are caught", {
  expect_false(is.defol(dmj_h))
})

test_that("obr objects are classed correctly", {
  expect_true(is.obr(test_obr))
})

test_that("non-obr objects are caught", {
  expect_false(is.obr(test_defol))
})

Try the dfoliatR package in your browser

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

dfoliatR documentation built on Aug. 10, 2023, 1:08 a.m.