tests/testthat/test-getISOlist.R

test_that("getISOlist works", {
  expect_equal(length(getISOlist()), 249)
  expect_mapequal(c(getISOlist("important"), getISOlist("dispensable")), getISOlist())
})

test_that("data sets used in getISOlist are consistent to each other", {
  expect_silent({
    ref <- getISOlist()
  })
  pop2015 <- readRDS(system.file("extdata", "pop2015.rds", package = "madrat"))
  expect_equal(length(ref), ncells(pop2015))
  expect_equal(unname(ref), getCells(pop2015))
  expect_error(getISOlist("blub"), "Unknown type")
})

Try the madrat package in your browser

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

madrat documentation built on Aug. 23, 2023, 5:10 p.m.