tests/testthat/test-spatial.R

test_that("add_geography_names requires GEOGRAPHY_CODE", {
  df <- data.frame(VALUE = 1)
  expect_error(add_geography_names(df), "GEOGRAPHY_CODE")
})

test_that("add_geography_names returns data when name exists", {
  df <- data.frame(GEOGRAPHY_CODE = "1", GEOGRAPHY_NAME = "Test")
  result <- suppressMessages(add_geography_names(df))
  expect_identical(result, df)
})

Try the nomisdata package in your browser

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

nomisdata documentation built on Feb. 10, 2026, 5:10 p.m.