tests/testthat/test-inspect_birthdaymonth.R

# common cases
test_that("inspect_birthdaymonth detects if birthday and birthmonth are correctly provided", {
  expect_equal(inspect_birthdaymonth("KNE1612"), TRUE)
  expect_equal(inspect_birthdaymonth("ALS3102"), FALSE)
  expect_equal(inspect_birthdaymonth("5AAA0101"), FALSE)
  expect_equal(inspect_birthdaymonth("3103AAA"), TRUE)
  expect_equal(inspect_birthdaymonth("ADF3103", format = "DDMM"), TRUE)
  expect_equal(inspect_birthdaymonth("31ADF03", format = "DDMM"), FALSE)
  expect_error(inspect_birthdaymonth("2108", format = "yyddmm"))
  expect_error(inspect_birthdaymonth(345))
})

Try the trustmebro package in your browser

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

trustmebro documentation built on June 8, 2025, 11:01 a.m.