tests/testthat/test-abbrev-check.R

library(testthat)
library(campfin)

test_that("abbreviations can be checked against another word", {
  expect_true(is_abbrev("VT", "Vermont"))
  expect_true(is_abbrev("NYC", "New York City"))
  expect_false(is_abbrev("NH", "Vermont"))
  expect_false(is_abbrev("DCA", "Washington, DC"))
  expect_false(is_abbrev("Vermont", "VT"))
})

Try the campfin package in your browser

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

campfin documentation built on Oct. 20, 2023, 5:06 p.m.