From b8c09908b1fc5859d69badca4b09b083de41c45d Mon Sep 17 00:00:00 2001 From: Tina815 Date: Fri, 5 Jan 2024 14:40:32 +0000 Subject: [PATCH] Style code --- tests/testthat/test-dob_from_chi.R | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tests/testthat/test-dob_from_chi.R b/tests/testthat/test-dob_from_chi.R index 5b770c3..888dd91 100644 --- a/tests/testthat/test-dob_from_chi.R +++ b/tests/testthat/test-dob_from_chi.R @@ -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 ) })