tests/testthat/test-SDMmodel2MaxEnt.R

m <- SDMtune:::bm_maxent
x <- SDMmodel2MaxEnt(m)

test_that("The function creates the correct output", {
  expect_s4_class(x, "MaxEnt")
  expect_equal(x@presence, .get_presence(m@data))
  expect_equal(x@absence, .get_absence(m@data))
  expect_equal(x@lambdas, m@model@lambdas)
  expect_true(x@hasabsence)
})

test_that("The function raises errors", {
  expect_snapshot_error(SDMmodel2MaxEnt(SDMtune:::bm_maxnet))
})

Try the SDMtune package in your browser

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

SDMtune documentation built on April 4, 2025, 1:11 a.m.