Skip to content

Commit

Permalink
Style code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tina815 authored and github-actions[bot] committed Jan 5, 2024
1 parent e0620ae commit b8c0990
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions tests/testthat/test-dob_from_chi.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,30 +232,35 @@ test_that("dob_from_chi gives messages when returning NA", {
test_that("Returns correct age - no options except fixed reference date", {
# Some standard CHIs
expect_equal(
age_from_chi(c(
"0101336489",
"0101405073",
"0101625707"
age_from_chi(
c(
"0101336489",
"0101405073",
"0101625707"
),
ref_date = as.Date("2023-11-01")
),
ref_date = as.Date("2023-11-01")),
c(90, 83, 61)
)

# Leap years
expect_equal(
age_from_chi(c(
gen_real_chi(290228),
gen_real_chi(290236),
gen_real_chi(290296)
age_from_chi(
c(
gen_real_chi(290228),
gen_real_chi(290236),
gen_real_chi(290296)
),
ref_date = as.Date("2023-03-01")
),
ref_date = as.Date("2023-03-01")),
c(95, 87, 27)
)

# Century leap year (hard to test as 1900 is a long time ago!)
expect_equal(
age_from_chi(gen_real_chi(290200),
ref_date = as.Date("2023-03-01")),
ref_date = as.Date("2023-03-01")
),
23
)
})
Expand Down

0 comments on commit b8c0990

Please sign in to comment.