tests/testthat/test-stac_to_english_str.R

test_that("use", {
  expect_equal(stac_to_english_str(0), "[no colonization has taken place]")
  expect_equal(stac_to_english_str(1), "Non-endemic at maximum age")
  expect_equal(stac_to_english_str(2), "Endemic")
  expect_equal(stac_to_english_str(3), "Endemic and non-endemic")
  expect_equal(stac_to_english_str(4), "Non-endemic")
  expect_equal(stac_to_english_str(5), "Endemic singleton at maximum age")
  expect_equal(stac_to_english_str(6), "Endemic clade at maximum age")
  expect_error(stac_to_english_str(-1))
  expect_error(stac_to_english_str(7))
  expect_error(stac_to_english_str(NA))
  expect_error(stac_to_english_str(NULL))
  expect_error(stac_to_english_str(Inf))
  expect_error(stac_to_english_str(c(1, 2)))
  expect_error(stac_to_english_str(c()))
  expect_error(stac_to_english_str(list()))
  expect_error(stac_to_english_str("nonsense"))
})
joshwlambert/DAISIEmainland documentation built on July 14, 2024, 5:40 p.m.