tests/testthat/test-stdz_zips.R

library(testthat)
test_that("stdz_zips works to format 9 digit numbers", {
  expected <- stdz_zips(902101010)
  expect_type(expected, "character")
  expect_equal(expected, "90210-1010")
})

test_that("stdz_zips works to format 5 digit numbers", {
  expected2 <- stdz_zips(90210)
  expect_type(expected2, "character")
  expect_equal(expected2, "90210")
})
parmsam/npiShiny documentation built on April 24, 2022, 5:41 a.m.