tests/testthat/test-age.R

library(lubridate)

test_that("age() calculates age in years given dob and doe", {
  dob <- as.POSIXct("1977-07-13")
  doe <- as.POSIXct("2021-04-04")


  expect_visible(age(dob, doe))

  expect_snapshot(age(dob, doe))
})
jtrampush/npsych.data documentation built on Feb. 25, 2025, 12:30 a.m.