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))
})
brainworkup/npsych.data documentation built on April 14, 2025, 6:14 p.m.