tests/testthat/test-sfind.R

test_that("sfind treats character numeric input as numeric", {

  expect_equal(nrow(sfind(260, list = "GW")), 1L)
  expect_equal(nrow(sfind("260", list = "GW")), 1L)

  expect_equal(
    sfind("260", list = "GW"),
    sfind(260, list = "GW")
    )

})

test_that("query capitalization does not matter", {

  expect_equal(
    sfind("Vietnam", list = "GW"),
    sfind("vietnam", list = "GW")
  )

})

Try the states package in your browser

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

states documentation built on Sept. 8, 2023, 5:48 p.m.