tests/testthat/test-get_country_code.R

test_string <- c("EL", "GR", "DED", "HU102")

test_that("Correct NUTS codes are handled", {
  expect_equal(get_country_code (test_string),
               c("GR", "GR", "DE", "HU"))
})


test_that("errors work", {
  expect_error(get_country_code (test_string,
                                 typology = "OECD"))
})
antaldaniel/regions documentation built on Sept. 27, 2022, 1:15 a.m.