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"))
})

Try the regions package in your browser

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

regions documentation built on June 21, 2021, 5:06 p.m.